From pianohacker at gmail.com Sat Nov 11 09:33:05 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sat, 11 Nov 2006 12:33:05 -0700 Subject: Basic structure of SDL C++ Message-ID: Woof, back to work. After a hiatus, I'm back to work on SDL C++. Right now I'm working on the parser, which has a couple of important architectural changes from the Java version: 1. Parser code is in two classes: EventParser, a stateless event parser; and a regular Parser that builds the document tree, built on EventParser 2. Parser is a recursive descent, rather than a token based parser Are these changes okay? While the parser type change is mostly to save me work (I'm adapting a small recursive descent parser framework), I feel that the split-up of the Parser class helps clean up the code. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061111/14da898d/attachment.html From pianohacker at gmail.com Sat Nov 11 09:41:22 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sat, 11 Nov 2006 12:41:22 -0700 Subject: Couple of things Message-ID: My own two cents on a couple of things: Has anyone done any testing to make sure that the .NET port works with Mono? If this is a priority, I imagine it wouldn't be too much work, and I could compile it on my machine. Also, there is currently no portable way to implement the 128 bit decimal type in SDL C++, that I know of, short of bundling the GNU MP library. What should I do? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061111/fee0dc3c/attachment.htm From dan at ikayzo.com Sat Nov 11 09:45:22 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Sat, 11 Nov 2006 14:45:22 -0500 Subject: Basic structure of SDL C++ In-Reply-To: Message-ID: <2nr2jmcxcxg217t.111120061145@mail.highspeedsystems.net> Hi Jesse, Welcome back :-) > Are these changes okay? Absolutely. Those changes sound fine. Dan _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Saturday, November 11, 2006 2:33 PM To: SDL_Developers Subject: Basic structure of SDL C++ Woof, back to work. After a hiatus, I'm back to work on SDL C++. Right now I'm working on the parser, which has a couple of important architectural changes from the Java version: 1. Parser code is in two classes: EventParser, a stateless event parser; and a regular Parser that builds the document tree, built on EventParser 2. Parser is a recursive descent, rather than a token based parser Are these changes okay? While the parser type change is mostly to save me work (I'm adapting a small recursive descent parser framework), I feel that the split-up of the Parser class helps clean up the code. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061111/893bf3f1/attachment.html From dan at ikayzo.com Sat Nov 11 09:52:23 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Sat, 11 Nov 2006 14:52:23 -0500 Subject: Couple of things In-Reply-To: Message-ID: > If this is a priority, I imagine it wouldn't be too much work, and I could compile it on my machine. That would be great. I wrote the C# port, but have only tested it on Windows. I don't anticipate any problems on the Mono platform. The only portability issues I've heard about are in the UI area. > Also, there is currently no portable way to implement the 128 bit decimal type in SDL C++, that I > know of, short of bundling the GNU MP library. That's a tough one. Do any other list members have suggestions? Eric? A description of the C# decimal type is here: http://msdn2.microsoft.com/en-US/library/364x0z75.aspx _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Saturday, November 11, 2006 2:41 PM To: SDL_Developers Subject: Couple of things My own two cents on a couple of things: Has anyone done any testing to make sure that the .NET port works with Mono? If this is a priority, I imagine it wouldn't be too much work, and I could compile it on my machine. Also, there is currently no portable way to implement the 128 bit decimal type in SDL C++, that I know of, short of bundling the GNU MP library. What should I do? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061111/055fb09e/attachment.htm From dan at ikayzo.com Sat Nov 11 20:48:23 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Sun, 12 Nov 2006 01:48:23 -0500 Subject: FW: Couple of things Message-ID: Forwarded... Eric - I added you to the list so you can participate in this discussion. I will be flying all day tomorrow. I'll respond after I am back and settled. _____ From: E M [mailto:eric at sulawesi.net] Sent: Saturday, November 11, 2006 11:17 PM To: Daniel Leuck; sdl-developers at ikayzo.org Cc: eric at sulawesi.net Subject: RE: Couple of things I am not an expert on numerical analysis, and have not worked on SDL. I wrote some code which used and compared GMP and OpenSSL BigNum libraries, which is my only hook into this thread... 29 decimal digits of precision is equivalent to 96 binary digits of precision. Therefore it seems reasonable to use GMP (or appropriate equivalent) with precision set to 0x60. However, the exponent in GMP is always a word--32 or 64 bits, where the "decimal" type is claiming 32 bits (128 - 96). So GMP in this case would only be equivalent on 32 bit systems. GMP does not claim to conform to any specific floating point standard (much less THE gold standard IEEE754). Nor does GMP even claim that the same operations will give the same results on architectures with different native word sizes. This might be a minor point if the implementation of SDL allows platforms to do calculations to the best of their abilities, instead of with exact equivalency. Do the Java and C# implementations give the same results when operating on 128 bit fp quantities? One route could be to restrict SDL to floats and doubles, and make this 128 bit (C#) fp operation an extension. That way the C++ port gets off the ground without having to worry about it :) Eric > Also, there is currently no portable way to implement the 128 bit decimal type in SDL C++, that I > know of, short of bundling the GNU MP library. That's a tough one. Do any other list members have suggestions? Eric? A description of the C# decimal type is here: http://msdn2.microsoft.com/en-US/library/364x0z75.aspx _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Saturday, November 11, 2006 2:41 PM To: SDL_Developers Subject: Couple of things My own two cents on a couple of things: Has anyone done any testing to make sure that the .NET port works with Mono? If this is a priority, I imagine it wouldn't be too much work, and I could compile it on my machine. Also, there is currently no portable way to implement the 128 bit decimal type in SDL C++, that I know of, short of bundling the GNU MP library. What should I do? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy "Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." -- B. Franklin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061112/fc5177b4/attachment.html From pianohacker at gmail.com Sun Nov 12 07:35:06 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sun, 12 Nov 2006 10:35:06 -0700 Subject: FW: Couple of things In-Reply-To: References: Message-ID: > I am not an expert on numerical analysis, and have not worked on SDL. I > wrote some code which used and compared GMP and OpenSSL BigNum libraries, > which is my only hook into this thread... > > 29 decimal digits of precision is equivalent to 96 binary digits of > precision. Therefore it seems reasonable to use GMP (or appropriate > equivalent) with precision set to 0x60. > > However, the exponent in GMP is always a word--32 or 64 bits, where the > "decimal" type is claiming 32 bits (128 - 96). So GMP in this case would > only be equivalent on 32 bit systems. > > GMP does not claim to conform to any specific floating point standard > (much less THE gold standard IEEE754). Nor does GMP even claim that the > same operations will give the same results on architectures with different > native word sizes. > > This might be a minor point if the implementation of SDL allows platforms > to do calculations to the best of their abilities, instead of with exact > equivalency. > > Do the Java and C# implementations give the same results when operating on > 128 bit fp quantities? > > One route could be to restrict SDL to floats and doubles, and make this > 128 bit (C#) fp operation an extension. That way the C++ port gets off the > ground without having to worry about it :) > > Eric > > > > > Also, there is currently no portable way to implement the 128 bit > decimal type in SDL C++, that I > > > know of, short of bundling the GNU MP library. > > > > That's a tough one. Do any other list members have suggestions? Eric? A > description of the C# decimal type is here: > http://msdn2.microsoft.com/en-US/library/364x0z75.aspx > > > I tried to compile the SDL C++ port on mono, and it got rather angry: Ikayzo/SDL/Tag.cs(345,7): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Ikayzo/SDL/Tag.cs(431,13): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Ikayzo/SDL/Tag.cs(554,7): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Ikayzo/SDL/Tag.cs(168,17): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Ikayzo/SDL/Tag.cs(195,17): warning CS0278: `System.Collections.Generic.ICollection' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Also, the openSSL bignum library doesn't seem to be distributed separately, making that option difficult. Does anyone know if we really need as many number types as we have? I would think that a 32-bit integer and a 64-bit floating point would be enough. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061112/9728478e/attachment.htm From dan at ikayzo.com Mon Nov 13 07:46:07 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Mon, 13 Nov 2006 12:46:07 -0500 Subject: FW: Couple of things In-Reply-To: Message-ID: Hi Jesse, The Mono issue appears to be a bug with the Mono compiler (those two interface methods are not ambiguous), but I will look into what can be done. Re: I would think that a 32-bit integer and a 64-bit floating point would be enough. The two options I would consider are: 1. Make the 128 bit decimal type an optional feature. 2. Redefine decimal as the most accurate decimal type available on the platform. I am leaning strongly towards one because I don't like the notion of something having significantly different meaning on different platforms. Any objections? Dan _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Sunday, November 12, 2006 12:35 PM To: sdl-developers at ikayzo.org Subject: Re: FW: Couple of things I am not an expert on numerical analysis, and have not worked on SDL. I wrote some code which used and compared GMP and OpenSSL BigNum libraries, which is my only hook into this thread... 29 decimal digits of precision is equivalent to 96 binary digits of precision. Therefore it seems reasonable to use GMP (or appropriate equivalent) with precision set to 0x60. However, the exponent in GMP is always a word--32 or 64 bits, where the "decimal" type is claiming 32 bits (128 - 96). So GMP in this case would only be equivalent on 32 bit systems. GMP does not claim to conform to any specific floating point standard (much less THE gold standard IEEE754). Nor does GMP even claim that the same operations will give the same results on architectures with different native word sizes. This might be a minor point if the implementation of SDL allows platforms to do calculations to the best of their abilities, instead of with exact equivalency. Do the Java and C# implementations give the same results when operating on 128 bit fp quantities? One route could be to restrict SDL to floats and doubles, and make this 128 bit (C#) fp operation an extension. That way the C++ port gets off the ground without having to worry about it :) Eric > Also, there is currently no portable way to implement the 128 bit decimal type in SDL C++, that I > know of, short of bundling the GNU MP library. That's a tough one. Do any other list members have suggestions? Eric? A description of the C# decimal type is here: http://msdn2.microsoft.com/en-US/library/364x0z75.aspx I tried to compile the SDL C++ port on mono, and it got rather angry: Ikayzo/SDL/Tag.cs(345,7): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable< Ikayzo.SDL.Tag>.GetEnumerator()' Ikayzo/SDL/Tag.cs(431,13): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable< Ikayzo.SDL.Tag>.GetEnumerator()' Ikayzo/SDL/Tag.cs(554,7): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable< Ikayzo.SDL.Tag>.GetEnumerator()' Ikayzo/SDL/Tag.cs(168,17): warning CS0278: `System.Collections.Generic.IList' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Ikayzo/SDL/Tag.cs(195,17): warning CS0278: `System.Collections.Generic.ICollection' contains ambiguous implementation of `enumerable' pattern. Method `System.Collections.IEnumerable.GetEnumerator()' is ambiguous with method `System.Collections.Generic.IEnumerable.GetEnumerator()' Also, the openSSL bignum library doesn't seem to be distributed separately, making that option difficult. Does anyone know if we really need as many number types as we have? I would think that a 32-bit integer and a 64-bit floating point would be enough. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061113/9f862e6b/attachment.html From pianohacker at gmail.com Mon Nov 13 08:52:09 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Mon, 13 Nov 2006 11:52:09 -0700 Subject: FW: Couple of things In-Reply-To: <4558af63.53545ee1.2b44.3bbeSMTPIN_ADDED@mx.google.com> References: <4558af63.53545ee1.2b44.3bbeSMTPIN_ADDED@mx.google.com> Message-ID: On 11/13/06, Daniel Leuck wrote: > > Hi Jesse, > > > > The Mono issue appears to be a bug with the Mono compiler (those two > interface methods are not ambiguous), but I will look into what can be done. > Re: I would think that a 32-bit integer and a 64-bit floating point would be > enough. > > > > The two options I would consider are: > > 1. Make the 128 bit decimal type an optional feature. > 2. Redefine decimal as the most accurate decimal type available on > the platform. > > > > I am leaning strongly towards one because I don't like the notion of > something having significantly different meaning on different platforms. > Any objections? > > > > Dan > > Well, there is one problem: right now, Java and C# support the 128-bit number, and C++ won't. This effectively means that we'll have two versions of the SDL language. Since the decimal type is probably only needed for special uses, this should be okay, but it could lead to problems down the road. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061113/80a83e21/attachment.htm From dan at ikayzo.com Mon Nov 13 09:38:27 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Mon, 13 Nov 2006 09:38:27 -1000 Subject: FW: Couple of things In-Reply-To: Message-ID: So you vote for #2? Does anyone else have an opinion? BTW- I included decimal because two of our users in the finance sector wanted a type accurate enough to handle currency. In Java this means BigDecimal. In C# "decimal" is used. _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Monday, November 13, 2006 8:52 AM To: sdl-developers at ikayzo.org Subject: Re: FW: Couple of things On 11/13/06, Daniel Leuck wrote: Hi Jesse, The Mono issue appears to be a bug with the Mono compiler (those two interface methods are not ambiguous), but I will look into what can be done. Re: I would think that a 32-bit integer and a 64-bit floating point would be enough. The two options I would consider are: 1. Make the 128 bit decimal type an optional feature. 2. Redefine decimal as the most accurate decimal type available on the platform. I am leaning strongly towards one because I don't like the notion of something having significantly different meaning on different platforms. Any objections? Dan Well, there is one problem: right now, Java and C# support the 128-bit number, and C++ won't. This effectively means that we'll have two versions of the SDL language. Since the decimal type is probably only needed for special uses, this should be okay, but it could lead to problems down the road. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061113/71cf38db/attachment.html From jdb at getsu.com Mon Nov 13 20:06:11 2006 From: jdb at getsu.com (J. David Beutel) Date: Mon, 13 Nov 2006 20:06:11 -1000 Subject: FW: Couple of things Message-ID: <45595CD3.4090304@getsu.com> Is the issue here that the 128-bit decimal number is inconsistent in the C++ library? If so, then another option is to support it but just let it be inconsistent. Or does SDL have a use-case for inter-platform communication? Unless all of the application's math remains inside SDL, such inconsistency seems inevitable with mixed languages and platforms. Is it better to have consistency within a given platform? Cheers, 11011011 "Daniel Leuck" wrote on Monday, November 13, 2006 09:38:27: > > So you vote for #2? Does anyone else have an opinion? > > > > BTW- I included decimal because two of our users in the finance sector > wanted a type accurate enough to handle currency. In Java this means > BigDecimal. In C# "decimal" is used. > > > > ------------------------------------------------------------------------ > > *From:* Jesse Weaver [mailto:pianohacker at gmail.com] > *Sent:* Monday, November 13, 2006 8:52 AM > *To:* sdl-developers at ikayzo.org > *Subject:* Re: FW: Couple of things > > > > > > On 11/13/06, *Daniel Leuck* > > wrote: > > Hi Jesse, > > > > The Mono issue appears to be a bug with the Mono compiler (those two > interface methods are not ambiguous), but I will look into what can be > done. > > Re: I would think that a 32-bit integer and a 64-bit floating > point would be enough. > > > > The two options I would consider are: > > 1. Make the 128 bit decimal type an optional feature. > 2. Redefine decimal as the most accurate decimal type available > on the platform. > > > > I am leaning strongly towards one because I don't like the notion > of something having significantly different meaning on different > platforms. Any objections? > > > > Dan > > > > > Well, there is one problem: right now, Java and C# support the 128-bit > number, and C++ won't. This effectively means that we'll have two > versions of the SDL language. Since the decimal type is probably only > needed for special uses, this should be okay, but it could lead to > problems down the road. > > -- > Jesse > > ----------- > There is a theory which states that if anybody ever discovers exactly > what the Universe is for and why it is here, it will instantly > disappear and be replaced by something even more bizarre and > inexplicable. There is another theory which states that this has > already happened. - Douglas Adams, author of Hitchhiker's Guide to the > Galaxy > From eric at sulawesi.net Mon Nov 13 23:03:24 2006 From: eric at sulawesi.net (E M) Date: Tue, 14 Nov 2006 01:03:24 -0800 (PST) Subject: FW: Couple of things In-Reply-To: <45595CD3.4090304@getsu.com> Message-ID: <20061114090324.21611.qmail@web50411.mail.yahoo.com> This is an interesting point. Both Java and C(++) would by definition use libraries for this 128 bit fp data type and operations. Even if C#'s decimal type is supported by the language, it is not supported by any piece of hardware and is therefore implicitly library based. GMP, an example of a world class Big Number library, wouldn't be any less consistent than probably already exists between C# and Java. Especially since BigDecimal is NOT based upon fp operations. It would actually be very interesting (though off topic) to write the native code to integrate GMP into Java, and then test how close a mpf_t with mantissa=96 approximates the behavior of BigDecimal as used in Java SDL. If anyone ever wants to do this, consider me a volunteer for the project :) Eric "J. David Beutel" wrote: Is the issue here that the 128-bit decimal number is inconsistent in the C++ library? If so, then another option is to support it but just let it be inconsistent. Or does SDL have a use-case for inter-platform communication? Unless all of the application's math remains inside SDL, such inconsistency seems inevitable with mixed languages and platforms. Is it better to have consistency within a given platform? Cheers, 11011011 "Daniel Leuck" wrote on Monday, November 13, 2006 09:38:27: > > So you vote for #2? Does anyone else have an opinion? > > > > BTW- I included decimal because two of our users in the finance sector > wanted a type accurate enough to handle currency. In Java this means > BigDecimal. In C# "decimal" is used. > > > > ------------------------------------------------------------------------ > > *From:* Jesse Weaver [mailto:pianohacker at gmail.com] > *Sent:* Monday, November 13, 2006 8:52 AM > *To:* sdl-developers at ikayzo.org > *Subject:* Re: FW: Couple of things > > > > > > On 11/13/06, *Daniel Leuck* > > wrote: > > Hi Jesse, > > > > The Mono issue appears to be a bug with the Mono compiler (those two > interface methods are not ambiguous), but I will look into what can be > done. > > Re: I would think that a 32-bit integer and a 64-bit floating > point would be enough. > > > > The two options I would consider are: > > 1. Make the 128 bit decimal type an optional feature. > 2. Redefine decimal as the most accurate decimal type available > on the platform. > > > > I am leaning strongly towards one because I don't like the notion > of something having significantly different meaning on different > platforms. Any objections? > > > > Dan > > > > > Well, there is one problem: right now, Java and C# support the 128-bit > number, and C++ won't. This effectively means that we'll have two > versions of the SDL language. Since the decimal type is probably only > needed for special uses, this should be okay, but it could lead to > problems down the road. > > -- > Jesse > > ----------- > There is a theory which states that if anybody ever discovers exactly > what the Universe is for and why it is here, it will instantly > disappear and be replaced by something even more bizarre and > inexplicable. There is another theory which states that this has > already happened. - Douglas Adams, author of Hitchhiker's Guide to the > Galaxy > "Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." -- B. Franklin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061114/19041db7/attachment.htm From dan at ikayzo.com Tue Nov 14 07:33:38 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Tue, 14 Nov 2006 07:33:38 -1000 Subject: FW: Couple of things In-Reply-To: <20061114090324.21611.qmail@web50411.mail.yahoo.com> Message-ID: Jesse, Dave, Eric - thank you for the feedback. I am going to amend the language spec to allow the decimal type to be provided according to the best abilities of the platform. _____ From: E M [mailto:eric at sulawesi.net] Sent: Monday, November 13, 2006 11:03 PM To: sdl-developers at ikayzo.org Subject: Re: FW: Couple of things This is an interesting point. Both Java and C(++) would by definition use libraries for this 128 bit fp data type and operations. Even if C#'s decimal type is supported by the language, it is not supported by any piece of hardware and is therefore implicitly library based. GMP, an example of a world class Big Number library, wouldn't be any less consistent than probably already exists between C# and Java. Especially since BigDecimal is NOT based upon fp operations. It would actually be very interesting (though off topic) to write the native code to integrate GMP into Java, and then test how close a mpf_t with mantissa=96 approximates the behavior of BigDecimal as used in Java SDL. If anyone ever wants to do this, consider me a volunteer for the project :) Eric "J. David Beutel" wrote: Is the issue here that the 128-bit decimal number is inconsistent in the C++ library? If so, then another option is to support it but just let it be inconsistent. Or does SDL have a use-case for inter-platform communication? Unless all of the application's math remains inside SDL, such inconsistency seems inevitable with mixed languages and platforms. Is it better to have consistency within a given platform? Cheers, 11011011 "Daniel Leuck" wrote on Monday, November 13, 2006 09:38:27: > > So you vote for #2? Does anyone else have an opinion? > > > > BTW- I included decimal because two of our users in the finance sector > wanted a type accurate enough to handle currency. In Java this means > BigDecimal. In C# "decimal" is used. > > > > ------------------------------------------------------------------------ > > *From:* Jesse Weaver [mailto:pianohacker at gmail.com] > *Sent:* Monday, November 13, 2006 8:52 AM > *To:* sdl-developers at ikayzo.org > *Subject:* Re: FW: Couple of things > > > > > > On 11/13/06, *Daniel Leuck* > > wrote: > > Hi Jesse, > > > > The Mono issue appears to be a bug with the Mono compiler (those two > interface methods are not ambiguous), but I will look into what can be > done. > > Re: I would think that a 32-bit integer and a 64-bit floating > point would be enough. > > > > The two options I would consider are: > > 1. Make the 128 bit decimal type an optional feature. > 2. Redefine decimal as the most accurate decimal type available > on the platform. > > > > I am leaning strongly towards one because I don't like the notion > of something having significantly different meaning on different > platforms. Any objections? > > > > Dan > > > > > Well, there is one problem: right now, Java and C# support the 128-bit > number, and C++ won't. This effectively means that we'll have two > versions of the SDL language. Since the decimal type is probably only > needed for special uses, this should be okay, but it could lead to > problems down the road. > > -- > Jesse > > ----------- > There is a theory which states that if anybody ever discovers exactly > what the Universe is for and why it is here, it will instantly > disappear and be replaced by something even more bizarre and > inexplicable. There is another theory which states that this has > already happened. - Douglas Adams, author of Hitchhiker's Guide to the > Galaxy > "Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." -- B. Franklin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061114/714daac5/attachment.html From dan at ikayzo.com Tue Nov 14 14:30:18 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Tue, 14 Nov 2006 14:30:18 -1000 Subject: Language Update Message-ID: I've updated the "Literals" section of the language guide (http://www.ikayzo.org/confluence/display/SDL/Language+Guide) to indicate that the decimal type should resolve to the highest precision decimal type provided by the underlying platform. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061114/3ca372e8/attachment.htm From pianohacker at gmail.com Sat Nov 18 09:18:05 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sat, 18 Nov 2006 12:18:05 -0700 Subject: Time span literal Message-ID: Could we change the time span literal so that it doesn't require seconds, to be consistent with the date/time literal? Or is there a good reason for the difference? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/416ab227/attachment.html From dan at ikayzo.com Sat Nov 18 09:36:09 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Sat, 18 Nov 2006 09:36:09 -1000 Subject: Time span literal In-Reply-To: Message-ID: Hi Jesse, The reason it's setup that way is that xx:xx is extremely ambiguous. It could be minutes and seconds, hours and minutes, a time, etc. When prefixed with a date, its clear that you are dealing with hours and minutes rather than minutes and seconds. One of SDL's design goals is that the literals be clear and unambiguous, even if you don't know the language spec. Dan _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Saturday, November 18, 2006 9:18 AM To: SDL_Developers Subject: Time span literal Could we change the time span literal so that it doesn't require seconds, to be consistent with the date/time literal? Or is there a good reason for the difference? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/6401c4fb/attachment.htm From pianohacker at gmail.com Sat Nov 18 09:43:09 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sat, 18 Nov 2006 12:43:09 -0700 Subject: Time span literal In-Reply-To: <455f60ad.545aa8cd.60bc.ffffa982SMTPIN_ADDED@mx.google.com> References: <455f60ad.545aa8cd.60bc.ffffa982SMTPIN_ADDED@mx.google.com> Message-ID: On 11/18/06, Daniel Leuck wrote: > > Hi Jesse, > > > > The reason it's setup that way is that xx:xx is extremely ambiguous. It > could be minutes and seconds, hours and minutes, a time, etc. When prefixed > with a date, its clear that you are dealing with hours and minutes rather > than minutes and seconds. One of SDL's design goals is that the literals be > clear and unambiguous, even if you don't know the language spec. > > > > Dan > > Ah, gotcha. Thanks for your quick reply. One other thing, though; are date/time literals allowed to be broken up between lines? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/ad53db43/attachment.html From pianohacker at gmail.com Sat Nov 18 09:53:58 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sat, 18 Nov 2006 12:53:58 -0700 Subject: Time span literal In-Reply-To: References: <455f60ad.545aa8cd.60bc.ffffa982SMTPIN_ADDED@mx.google.com> Message-ID: Sorry, but one other thing: the language guide isn't quite clear about which variant of Base64 SDL uses. I'm going to dig in to the code and update the page, but maybe we should have a formal EBNF grammar to answer these questions. The current language guide is good for users, but a grammar would help us keep all the implementations in sync. Just my two cents. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/1845da32/attachment.htm From dan at ikayzo.com Sat Nov 18 10:55:38 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Sat, 18 Nov 2006 10:55:38 -1000 Subject: Time span literal In-Reply-To: Message-ID: > One other thing, though; are date/time literals allowed to be broken up between lines? No, unless a "\" is used at the end of the line to connect it to the next line. _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Saturday, November 18, 2006 9:43 AM To: sdl-developers at ikayzo.org Subject: Re: Time span literal On 11/18/06, Daniel Leuck wrote: Hi Jesse, The reason it's setup that way is that xx:xx is extremely ambiguous. It could be minutes and seconds, hours and minutes, a time, etc. When prefixed with a date, its clear that you are dealing with hours and minutes rather than minutes and seconds. One of SDL's design goals is that the literals be clear and unambiguous, even if you don't know the language spec. Dan Ah, gotcha. Thanks for your quick reply. One other thing, though; are date/time literals allowed to be broken up between lines? -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/4275e603/attachment.html From dan at ikayzo.com Sat Nov 18 11:00:51 2006 From: dan at ikayzo.com (Daniel Leuck) Date: Sat, 18 Nov 2006 11:00:51 -1000 Subject: Time span literal In-Reply-To: Message-ID: > I'm going to dig in to the code and update the page Great. Thank you. > maybe we should have a formal EBNF grammar This is definitely needed, and I hope to get to it sometime soon. Obviously, if you are interested you are welcome to take this. _____ From: Jesse Weaver [mailto:pianohacker at gmail.com] Sent: Saturday, November 18, 2006 9:54 AM To: sdl-developers at ikayzo.org Subject: Re: Time span literal Sorry, but one other thing: the language guide isn't quite clear about which variant of Base64 SDL uses. I'm going to dig in to the code and update the page, but maybe we should have a formal EBNF grammar to answer these questions. The current language guide is good for users, but a grammar would help us keep all the implementations in sync. Just my two cents. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/e8ec0757/attachment.htm From pianohacker at gmail.com Sat Nov 18 11:12:30 2006 From: pianohacker at gmail.com (Jesse Weaver) Date: Sat, 18 Nov 2006 14:12:30 -0700 Subject: Time span literal In-Reply-To: <455f7485.4cb41505.696d.ffffe459SMTPIN_ADDED@mx.google.com> References: <455f7485.4cb41505.696d.ffffe459SMTPIN_ADDED@mx.google.com> Message-ID: On 11/18/06, Daniel Leuck wrote: > > > I'm going to dig in to the code and update the page > > > > Great. Thank you. > Already done; no problem. > maybe we should have a formal EBNF grammar > > > > This is definitely needed, and I hope to get to it sometime soon. > Obviously, if you are interested you are welcome to take this. > I'll start work on it tomorrow on Confluence. -- Jesse ----------- There is a theory which states that if anybody ever discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams, author of Hitchhiker's Guide to the Galaxy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.ikayzo.org/pipermail/sdl-developers/attachments/20061118/ca56cc22/attachment.html