Hacker News new | ask | show | jobs
by lispm 3668 days ago
> whole implementation fits in your head too

Of the axiomatic core. But not of any programming language.

> But it turns out that this axiomatic core is too impoverished for a lot of programming.

It's not even a programming language. It's just an axiomatic core. If you try to use it for programming you must be doing something wrong.

> is writing a lexer. I don't see anything that Lisp offers you in that respect.

Lisp is a language family, not language implementation with a library, which happens to include a lexer library.

If you mean Common Lisp as a programming language with implementations, there are portable lexers.

http://www.cliki.net/LEXER

https://github.com/drewc/smug

https://github.com/lispbuilder/lispbuilder

Writing your own lexer in Lisp shouldn't be too hard. People have written applications in Lisp which includes lexer functionality.

1 comments

I don't think your opinion about the axiomatic core matches that of all, or even most, Lisp programmers.

And I'm not saying it's not possible to write lexers in Scheme or Common Lisp. I'm saying that there's no real benefit to doing so over C or even Python. You're using the exact same algorithms and just transliterating it into a different language with more awkward syntax for that problem. The code isn't any shorter.

Related to the other commenter as well, the production quality Julia parser in Lisp doesn't use parser combinators. It uses recursive descent. It's C code written in Lisp syntax.

> I don't think your opinion about the axiomatic core matches that of all, or even most, Lisp programmers.

I have never seen anyone developing software with the 'axiomatic core'. But I see Emacs Lisp, Common Lisp, Scheme, etc. developers.

> And I'm not saying it's not possible to write lexers in Scheme or Common Lisp. I'm saying that there's no real benefit to doing so over C or even Python.

Depends on what level you program. With Lisp it is possible to develop a compact syntax, which expresses domain-level concepts, very easily. Interactive development is many times more convenient than in C.

> You're using the exact same algorithms and just transliterating it into a different language with more awkward syntax for that problem. The code isn't any shorter.

I have a surprise for you: it's perfectly legal to write imperative code in Lisp. Lisp is at its heart a multi-paradigm language with the option to add many other paradigms.

With Python you develop mostly object-oriented and in C it's mostly imperative. With something like Common Lisp you can do what you want.