Make a Lisp in Nim
hookrace.net
Make a Lisp in Nim
1–10 of 48 posts
Re: Make a Lisp in Nim
#2Re: Make a Lisp in Nim
#3I had this idea as well (after seeing Make a Lisp on HN). Anything that you found challenging in porting the Python version to Nim?
Re: Make a Lisp in Nim
#4> Rust: build with --release. 10X performance boost!
That might mean that Rust would top the charts instead of Nim.
[1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
Re: Make a Lisp in Nim
#5Are your graphs up to date ? Seems just an hour ago [1]: > Rust: build with --release. 10X performance boost! That might mean that Rust would top the charts instead of Nim. [1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
Re: Make a Lisp in Nim
#6Are your graphs up to date ? Seems just an hour ago [1]: > Rust: build with --release. 10X performance boost! That might mean that Rust would top the charts instead of Nim. [1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
if *strn == "&".to_string() { ... }
is a very slow (and verbose) way to write if &strn[..] == "&" { ... }
and rr_string("'".to_string() + k.to_string() + "' not found".to_string())
is a very slow (and verbose) way to write rr_string(format!("'{}' not found", k))`
Etc. etc.[1]: https://github.com/kanaka/mal/blob/master/rust/src/env.rs
Re: Make a Lisp in Nim
#7Are your graphs up to date ? Seems just an hour ago [1]: > Rust: build with --release. 10X performance boost! That might mean that Rust would top the charts instead of Nim. [1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
Re: Make a Lisp in Nim
#8Are your graphs up to date ? Seems just an hour ago [1]: > Rust: build with --release. 10X performance boost! That might mean that Rust would top the charts instead of Nim. [1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
It's weird that people that make benchmarks don't investigate which flags to pass for getting the most optimized build. Many compilers don't do max optimization by default. In particular, people making benchmarks with rust code seem to tend to forget or be unaware of the `release` flag.
Re: Make a Lisp in Nim
#9Are your graphs up to date ? Seems just an hour ago [1]: > Rust: build with --release. 10X performance boost! That might mean that Rust would top the charts instead of Nim. [1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
Just one glance at the Rust version (e.g. [1]) shows a lot of needless allocation. For example: if *strn == "&".to_string() { ... } is a very slow (and verbose) way to write if &strn[..] == "&" { ... } and rr_string("'".to_string() + k.to_string() + "' not found".to_string()) is a very slow (and verbose) way to write rr_string(format!("'{}' not found", k))` Etc. etc. [1]: https://github.com/kanaka/mal/blob/master/rus…
EDIT: further, looks like it's on a really old Rust: https://github.com/kanaka/rust-pcre wasn't updated since October...
EDIT 2: I tried to update the code, but it's really, really out of date, and will be a ton of work. So I've just submitted https://github.com/kanaka/mal/pull/23 instead. :(
Re: Make a Lisp in Nim
#10Are your graphs up to date ? Seems just an hour ago [1]: > Rust: build with --release. 10X performance boost! That might mean that Rust would top the charts instead of Nim. [1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
Yes, I updated it already.
[ed: Also interesting to note that the clojure version is much slower than scala/java. If nothing else, I guess it's an indication of performance gains that can be had by implementing parts of a clojure program in java (unless there's something off with the clojure implementation, of course.]