So crazy it might just work.
I found it so pleasant writing C in S-expr that I gradually rewriting my C code with it.
11–20 of 45 posts
So crazy it might just work.
I found it so pleasant writing C in S-expr that I gradually rewriting my C code with it.
Why replace "struct" with "class"? These are completely different things. >.>
That said, the only difference between a struct and a class is that struct member defaults to public, and class members default to private.
> Because LISP is expressive and C is fast and I wanted the best of both worlds is the short answer. I'm not sure how well known it is, but some Lisps can be statically compiled to machine code. But one thing I've wondered about is how good can it get? Are there any benchmarks for Lisp vs. C?
> Because LISP is expressive and C is fast and I wanted the best of both worlds is the short answer. I'm not sure how well known it is, but some Lisps can be statically compiled to machine code. But one thing I've wondered about is how good can it get? Are there any benchmarks for Lisp vs. C?
Some Lisps? Almost all Common Lisps compile to native machine code. Which is why CL programs tend to run orders of magnitude faster than e.g. Python programs. (But they're still typically slower than C because of runtime memory allocation and typetag checking.)
Earlier quoted context omitted.
Some Lisps? Almost all Common Lisps compile to native machine code. Which is why CL programs tend to run orders of magnitude faster than e.g. Python programs. (But they're still typically slower than C because of runtime memory allocation and typetag checking.)
Talking about speed, someone put this online http://www.nexoid.at/tmp/scheme-benchmark-r7rs.html
It was created to facilitate using all of the scientific libs in C++ by a chemistry professor for the creation of molecules [2]. It's a big codebase. I'll have to look at LispY C, since on first impression it seems smaller, and I like C!
[1] https://github.com/drmeister/clasp [2] https://github.com/drmeister/clasp