|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
[scala] use scala to make a custom languageI'm total new to Scala.
It seems a very interesting language. I'm interested in the possibility to use Scala features (like implicit conversions, operators as method ecc.) to create a custom programming language. I think that the impossibility to specify operator precedence/associativity could be an obstacle. I'm, for example, interested in the possibility to create a language with syntax similar to perl6. The operators are: in particular: ~ string concatenation (coerce numbers to string)
~~ for regexp (through external library, I know Scala has not regexp) math operator (+-*/ ecc ) coerce strings to numbers Do you think it's possible ? Is there any prevision to allow full control of operators (precedence, associativity ecc ecc ) ? |
|
|
Re: [scala] use scala to make a custom languageyes I think you have to make some compromises :-) There was a good article about operators at Code Commit: http://www.codecommit.com/blog/scala/implementing-groovys-elvis-operator-in-scala |
|
|
Re: [scala] use scala to make a custom languageOn Tue, Jul 8, 2008 at 8:38 AM, Landei <Daniel.Gronau@...> wrote:
I hope this will be implemented in future Scala releases.
Any prevision ? It could be a great feature and with the ability to implement foreign languages syntax in Scala it will be easiest to port chunk of code and library from different languages to Scala.
Very interesting !
thanks
Francesco |
|
|
Re: [scala] use scala to make a custom languageI doubt that custom precedence would ever come to Scala. That would
require syntactic level configurability based on the type of a symbol, and most language people wouldn't dare to mix type checking with parsing, its probably not a good idea. (The exception being C++, but I think they do something hacky to avoid that). On Tue, Jul 8, 2008 at 4:55 PM, Francesco Pasqualini <frapas@...> wrote: > I hope this will be implemented in future Scala releases. > Any prevision ? > It could be a great feature and with the ability to implement foreign > languages syntax in Scala it will be easiest to port chunk of code and > library from different languages to Scala. |
|
|
Re: [scala] use scala to make a custom language... I understand.
But IMHO, without custom precedence, the ability to create/overoad operators is less useful. Francesco On Tue, Jul 8, 2008 at 11:22 AM, Sean McDirmid <sean.mcdirmid@...> wrote: I doubt that custom precedence would ever come to Scala. That would |
|
|
Re: [scala] use scala to make a custom languageOn Tue, Jul 8, 2008 at 12:47 PM, Francesco Pasqualini <frapas@...> wrote: ... I understand. Not at all. It brings discipline. (note that I would like custom precedence too, though....) -- __~O -\ <, Christos KK Loverdos (*)/ (*) http://ckkloverdos.com |
|
|
Re: [scala] use scala to make a custom language"brings discipline" must mean "there are arbitrary rules to follow" then. Please, for discipline, start writing Java code with labels containing line numbers:
_10: System.out.println("Hello"); _20: etc. 2008/7/8 Christos KK Loverdos <loverdos@...>:
|
|
|
Re: [scala] use scala to make a custom languageHahaha... good :-)
On Tue, Jul 8, 2008 at 1:50 PM, Ricky Clarkson <ricky.clarkson@...> wrote: "brings discipline" must mean "there are arbitrary rules to follow" then. Please, for discipline, start writing Java code with labels containing line numbers: -- __~O -\ <, Christos KK Loverdos (*)/ (*) http://ckkloverdos.com |
| Free Forum Powered by Nabble | Forum Help |