gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.32k stars 155 forks source link

language pragams #435

Open maninalift opened 10 years ago

maninalift commented 10 years ago

I'm a big fan of Haskell's language pragmas. They keep information about how code should be compiled with the code in a simple declarative way.

I would like to be able to be able to import the prelude and set the --const compile flag using

{-# LANGUAGE WithPrelude NoMutability#-}

..or perhaps as this is livescipt something more terse and elegant.

Once you have language pragmas, it allows for adding experimental features. Again look to Haskell.

robotlolita commented 10 years ago

I would rather have:

compile-using constants

It's definitely a nice feature to have, specially if we can trigger particular optimisation paths that might be controversial by using this (e.g.: compile-using inlined(f)). I'm not sure this could be added to LS1 with much of the benefits, but it may be something to keep in mind for LS2.

maninalift commented 10 years ago

I have thought about this in the past but it came back to me because I was messing with Meteor where I was trying to work out the best way to include the prelude in particular source files. https://github.com/maninalift/meteor-examples-livescript

May I ask how LS2 is going?