Many programmers (not me, but apparently a large number) find Python to be a readable language, and Lisp to not be readable. You give up macros when using Python, but maybe that's not a big deal to many developers. Maybe if you're running a company with a lot of turnover, macros aren't a big deal. Or maybe you just don't understand or don't care about macros. I love them but they can be hard to get right.
So what if there was a language with Python syntax, complete with whitespace rules, that compiled to Clojure? My google-fu did not find any such projects. Clojure is a really good language even without macros. The code generated by the new language would be trivially interoperable with any other Clojure code.
It would have to make available everything that is in Clojure. I have no idea how much work it would be to:
- Parse a Pythonesque language
- Provide access to everything in Clojure core
- Keep up with all new releases of Clojure
- Write documentation
- Produce Clojure code that is easy to read and modify (should not be difficult)
The goals would be:
- Eliminate the Lisp syntax barrier to getting programmers to try Clojure.
- Make Clojure acceptable to universities that want to avoid Lisp syntax.
- Provide a stepping stone so that programmers can learn Clojure concepts, then when they want more control over their language, they can start writing Clojure without giving up any of their existing code.
13 comments:
Why don't you just write a 'clojure' library for python. Problem solved. Syntax for lisp? Then it's no longer a lisp. I always thought that's obvious. When in doubt, go visit the dylan folks.
Check out Julia (http://julialang.org). It's pretty clearly a LISP derivative, though it's not as mature as clojure yet. The syntax is so close to Python that I keep typing ':' after if statements. And it has macros every bit as powerful as clojures.
A Python DSL in Clojure? Too difficult without reader macros, but who knows.
sorry man but it hasn't any sense...the power about clojure and lisp is than this is homoiconic..python don't, you can't write full powered lisp with python so..if you don't like the lisp syntax maybe would be a better idea begin use haskell or f#, both has similar syntax to python, actually, f# has the "in-famous" indentation, but in this case it's not obligatory..
when I begin learn clojure many things was weird to me..but basically all the weird things are related to the great consistence from lisp and clojure, you don't need create a new syntax when you use clojure because its syntax let you write everything...so..
I repeat you, if you're interested in functional languages but don't like lisp syntax, you has ocaml haskell or f#... but please..don't try mix milk with vodka...if you are really interested in lisp then learn lisp syntax, which by the way, it's the most powerfull syntax ever...
It is worth bearing in mind that, originally, lisp wasn't designed to be written in s-expressions either.
McCarthy proposed writing in m-expressions, which would then be converted into s-expressions. The idea being, if I recall correctly, that you could have different m-expressions to suit different tastes.
In any case, a friend and I did something similar in making a toy language that would be rewritten to scheme. We got bored of it pretty quickly, but in the stuff we did get done, we didn't run into too many problems.
Thanks to you all for your comments.
@Anonymous Not everyone is looking for a lisp. Surely you have to believe that Clojure offers more than the ability to write macros.
@Mike Awesome. It's not Clojure, but it seems to do most of what I need in a language, so I'll have to give it a try.
@Simon You're right, I should just call it a DSL.
@coco See my answer to Anonymous.
Also: my DSL would not be for me, it would be a tool that I could use to show Clojure to scientists. I don't know how much you've worked with scientists, but F# would be far outside the realm of possibility. I'd be satisfied with reading code that uses recursion instead of for loops. These are people who write programs because they have to, not because they want to, so it would have to be close to what they already know.
@Andrew That's interesting. I've never heard of m-expressions.
"I don't know how much you've worked with scientists, but F# would be far outside the realm of possibility"...is it a joke???...f# is more used in the scientist world than clojure, and actually the main contracts for computing scientists is for f# programmers, cambridge has contracted several f# programmers for biology and DNA researchs and for numerical computng too...actually f# is really well suited for numerical computing, in that side is better a static type language than a dynamic, about recursion...well, recursion is part almost any functional language, actually, the clr and mono are best suited for recursion than the jvm, because this come with tail call optimization, so the recursion is more elegant in f# than in clojure (not so elegant as haskell but is really good), and you've pattern matching, a incredible feature used with recursion...give it a try (or to haskell) and maybe you like it...now..I really love clojure too, but basicly I love clojure because is homoiconic and has the most powerfull computing invention...macros...and I'm not sure if a python implementation would have them...
"f# is more used in the scientist world than clojure,"
I'm not sure what to make of that comparison. If you compare to languages like Fortran, C++, Matlab and R, neither is used much at all.
"and actually the main contracts for computing scientists is for f# programmers, cambridge has contracted several f# programmers for biology and DNA researchs and for numerical computng too"
I'm sure there are domains where F# is used, but my area (statistical analysis) is not one of those areas, at least I've never been looking at someone's code and run across F#. I just do not see any chance that they'd be willing to learn F#.
Plus I love Clojure, so that's the language I will promote to others. I'm addicted to s-expressions.
someone started it some time ago
https://github.com/apatil/pleajure
clojure has no reader macros like common lisp but reader is modificable by users using its java guts:
http://briancarper.net/blog/449/clojure-reader-macros
Sounds you don't want closure in the first place, but more something like: http://nimrod-code.org/
Which also happens to get rid of the dreaded JVM...
Among the various techniques some of the aspects of google, eg, organic search, PPC
marketing, CTR, CPC, SEM, ROI, keyword density,
long-tail keywords, etc. And biggest online encyclopedia in the world,
is one big name in the google market that have been successfully operating in India, UK, America and Australia for
quite some years now. And YES my full version of GSA Website Submitter.
If you have an HTML sitemap that guides search engines to your site.
Feel free to surf to my site indianapolis search engine optimization
It is a must for you to find what people are really searching
for. Before it could take me up to two weeks to find the things we need in
search. Using these 3 simple tips, businesses of any size can get started on an effective
video marketing campaign to add to their current Business strategy.
my page; keyword search engine ranking
Post a Comment