Live data from Hacker News

Make a Lisp

github.com

31–40 of 44 posts

Re: Make a Lisp

#31
> Modern polyglot developers do not memorize dozens of programming languages. Instead, they learn the peculiar terminology used with each language and then use this to search for their answers.

This is the clearest explanation of how polyglot programming works I ever read.

Great work in general, very valuable resource for studying and comparing different languages. I'd like to add one more resource to the mentioned in the guide: http://rigaux.org/language-study/syntax-across-languages/ - it's similar to hyperpolyglot, but has comparisons between non-related languages too. And focuses solely on syntax.

Re: Make a Lisp

#32
post #27

I'm working on a lisp interpreter right now, so this should be useful for reference. One question, how would I go about implementing tail call recursion? I's assume that's a pretty important thing to have in lisp (or any functional language for that matter). I'm working in ruby, if that matters.

I assume you already saw this by now: https://github.com/kanaka/mal/blob/master/process/guide.md#s...

I did not, thanks for the link!

Re: Make a Lisp

#33

Obligatory cloc reading to see which implementations were shortest: ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 17 294 155 3919 C 18 446 383 3356 C# 19 472 235 3314 Visual Basic 17 322 131 2945 Java 17 322 134 2872 Go 17 299 147 2636 Bourne Shell 16 304 241 2308 Pe…

Apparently Maven is uniquely suited for writing a LISP!

Or at least, describing the project for one.

https://github.com/kanaka/mal/blob/90ab31710e9a495ba3aebf794...

The Maven, HTML, C headers, and CSS are just support.

Re: Make a Lisp

#34

Obligatory cloc reading to see which implementations were shortest: ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 17 294 155 3919 C 18 446 383 3356 C# 19 472 235 3314 Visual Basic 17 322 131 2945 Java 17 322 134 2872 Go 17 299 147 2636 Bourne Shell 16 304 241 2308 Pe…

Forth is missing. Personally I found Forth implementation the most impressive, even more so than bash. Well, Make comes close :)

Hm, I guess clock doesn't support forth? I just ran `cloc .` from the root directory.

Re: Make a Lisp

#35
post #10
post #6

The language statistics ribbon for this is beautiful.

Shameless plug, but I have a project with 24 languages if you want: https://github.com/bfontaine/Katas

This is right up my alley. You might be interested in a project of mine I work on from time to time: https://github.com/seaneshbaugh/rosetta-euler

Re: Make a Lisp

#36
post #2

[deleted]

It's still a worthwhile effort even if all he did was aggregate them.

Looking at the coding style he certainly wrote every single bit by his own.

The code itself is standard of the shelf lisp introduction as done by good universities in the last decades. (SICP, Lisp in Small Pieces, ...). But bringing this simple code to the masses who just known C, python, perl, java, php or ruby is the interesting part. They can now relate to eval, tailcalls or an env.

Re: Make a Lisp

#38
post #10

Earlier quoted context omitted.

Shameless plug, but I have a project with 24 languages if you want: https://github.com/bfontaine/Katas

This is right up my alley. You might be interested in a project of mine I work on from time to time: https://github.com/seaneshbaugh/rosetta-euler

Sweet!

Re: Make a Lisp

#39
post #20
post #14

Earlier quoted context omitted.

This is interesting. Since it's hard to read, I've extracted the language statistics and I'll leave them here: C# - 7.9% C - 7.2% Rust - 7.1% Visual - Basic - 6.6% Makefile - 6.5% Java - 5.8% Forth - 5.0% Go - 4.5% PostScript - 4.2% Haskell - 4.0% Shell - 3.8% Perl - 3.5% JavaScript - 3.4% Matlab - 3.2% Scala - 3.1% PHP - 3.1% OCaml - 3.0% Lua - 2.8% R - 2.7% Python - 2.7% CoffeeScript - 1.9% Ruby - 1.9% Clojure - 1.…

I was curious about this, so here is the result of my digging. `core` has inline lambdas in Ruby: :prn => lambda {|*a| puts(a.map {|e| _pr_str(e, true)}.join(" "))}, but separately defined ones in Python def prn(*args): print(" ".join(map(lambda exp: printer._pr_str(exp, True), args))) return None ... 'prn': prn, Note that `return None` isn't needed - Ruby doesn't have it, so that's a "wasted" line. The function shou…

Python is one of the oldest implementations and I ought to do a another pass through to clean it up sometime.

I'm happy to take pull requests that make an implementation shorter and/or more idiomatic as long as it doesn't change the overall order/flow (and doesn't break any of the tests of course).

Re: Make a Lisp

#40

> Modern polyglot developers do not memorize dozens of programming languages. Instead, they learn the peculiar terminology used with each language and then use this to search for their answers. This is the clearest explanation of how polyglot programming works I ever read. Great work in general, very valuable resource for studying and comparing different languages. I'd like to add one more resource to the mentioned i…

Good resource. Added.
Post reply on HN