Skip to content

Comment on A Lisp based programming language I'm creating

Comments

Well. This language seems to be senseless. It looks like all those parenthesis are there to make language look like Lisp. Well, I'd grade Lispness of this code as totaly non-Lisp like. Far more interesting would be atempt to create C-looking functional language that could look like that:

  define( fact, ( n ), function(
      cond( ( n = 0 || n = 1, 1 )
            ( n > 1, n * fact(n-1) )
      )
  )

  print( fact( 5 ) )
I think I'd try to program in language like that. Lisp way of thinking, but parenthesis are bit more helpful and there are "normaly" used operators which makes language bit more readable. Your project looks like another purely academic example. I think purely academic examples sucks because don't teach people to do what is actualy needed.

I didn't read your code carefully, but "endles" elsif chains looks terrible and I think there shouldn't be stuff like that in tutorial project. Moreover I believe java isn't good tool for that purpouse( another nobody seems to teach ). I'd use flex and bison or perl if you realy want to implement lexical analisis yourself..

Well, explaining your point of view - the parenthesis aren't there only to make the language look like lisp - I used it for its syntax and for delimit the scopes.

Now, about the "else if", I also felt bad about it, and I'm thinking about a changing for it, I'm still working on it, as in a lot of features. If you want to add some feature or change something, please feel free and do it - just show your purpose before do anything, so we might discuss how it will work .

And yes, I started this project while on university, and I don't think it sucks, because my intention is not to create a new technology - at first instance - but help people who want to learn how to write a programming language (as you can read on the README file), whatever comes to this project (bad or good), it will be well accepted for learning.

I also agree with you that Java is not the best tool for implement such thing, and I was thinking about rewriting it to C++ or Python.

Take a look at Epoch[1]. It’s written by an acquaintance of mine, Mike Lewis, and I’ve watched it mature over the years from a mere forum thread into a fairly robust language. Unfortunately he tends to be quite busy, so development is slow, albeit constant. Still, the design is solid.

[1] http://code.google.com/p/epoch-language/

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.