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.31k stars 155 forks source link

is it too much magic...in LiveScript #721

Open skandasoft opened 9 years ago

skandasoft commented 9 years ago

With coffeescript being too rigid for any new request...I think it would be great to have a nice alternative like LiveScript... I found LiveScripts offers too many things....can you limit the no of ways of doing a thing(1 thing can be done in n different ways) and let the user decide his own macro(ways for using macro).. keep it clean and simple to pick up and running..

heavyk commented 9 years ago

forgive me for misunderstanding, but it seems your saying that coffee is too rigid, however LS is a less rigid alternative, yet still offers too many alternatives. ---- right?

so, why don't you just fork the one you like more and make it "just right"? if you look at the LS code (dunno about the coffee), it's really not that hard to add your own macros to it. I've made my own macros for LS a few times now and have been quite happy. it has been really fun to diddle around in a language and make make it my own. I removed a few things, but added others, like atumatic require module installation if not found in node_modules ... but you know those macros were important to only me cause everyone has a different way of installing their modules and stuff. fork the LiveScripts man. I'm probably going to do it again soon! there are some new things in the 1.4 that I really like. no big deal, I'll just re-add my macros. :)

vendethiel commented 9 years ago

you might be interested in #219.

skandasoft commented 9 years ago

@heavyk I am not here to criticize the Livescript. Just wanted to have a healthy conversation to see if it is something that people would want to have. And this conversation is not about macros..it is to keep the features to minimum and let the macros handle the rest. as for as your suggestion of forking..how about everybody forking their own way..

heavyk commented 9 years ago

haha, I didn't think you were criticizing.

one thing that would be really useful in creating what you suggest would be some functions on the LS AST (like compile) which actually generate LS again. then, we could all utilize a common AST and heavyk-script would actually be compatible with skandasoft-script ... heavyk-script would compile to LS, then that ast would be readable by skandasoft-script. so we would essentially both be writing in our own languages, but everyone would see it as their own. the only thing necessary would be for someone to extend the ast classes and override that compile function. hmmm, interesting thought!

well, thanks for the healthy discussion, I may actually work on this. what a great idea :) cheers

EDIT: you'd have to implement your own lexer/grammar obviously, but it could totally work. anyone could implement their own grammar, as long as it produced LS ast... (what you mean by macros would essentially become a system for generating grammar files). this is pretty meta... lol

robotlolita commented 9 years ago

I ended up never actually working on this but: https://github.com/gkz/LiveScript/issues/328#issuecomment-26763043