4 ms·
To be a bit more specific as to where else these ideas are found: * Run regular code at compile time Lisp, of course. Since very long ago. * Extend the l
by klibertp 12y ago
To be a bit more specific as to where else these ideas are found:
* Run regular code at compile time
Lisp, of course. Since very long ago.
* Extend the language (AST templates and macros);
this can be used to add a form of list comprehensions to the language!
Lisp, but also Dylan, Elixir, JS with Sweet.js and more. See for example here: https://opendylan.org/articles/macro-system/index.html https://opendylan.org/articles/macro-system/index.html
* Add your own optimizations to the compiler!
I'm not sure here.
* Bind (easily) to your favorite C functions and libraries
Almost every serious language has FFI for C. Nimrod offers a possibility to use statically linked libraries, which is not very popular, but for example Gambit Scheme does this since long ago.
* Unified Call Syntax, so mystr.len() is equivalent to len(mystr)
Lua, somewhat. Also Dylan again.
* Good performance -- not placing too much emphasis on this,
but it's faster than C++ in his benchmark
Too many to count.
* Compile to JavaScript
OCaml. And more: almost every language has a compile-to-JS project for it (although only a couple are workable).
EDIT:
> typesafe enums are also extremely old
Aren't those just sum types? This would make them as old as ML at least.
This of course doesn't make Nimrod any less interesting a language and some combinations of those features may be rather novel. Still, 'everything old is new again' I think is 100% true for all of these features. In reality you won't ever encounter truly unprecedented features in general purpose languages and outside of academia: one can go to LtU site for those. All the rest languages are built on really old (proven) concepts, which they reimplement and package in a (very) different ways. I have no idea why would you get downvoted for stating such fact.
- sillysaurus3 12y agoI have no idea why would you get downvoted for stating such fact. And not merely downvoted, but karma carpet bombed (-10). Such an honor used to be reserved for troll comments rather than true statements.
- TylerE 12y agoSimple... the list of languages that provide Lisp-level dynamism AND C level performance is rather short.
- sillysaurus3 12y agoHave you ever actually used Lisp, or are you going off of speculation? I have. It can deliver just short of C level performance. This is like someone going onto a forum and saying "Java is slow!" while ignoring the fact that trading institutions use Java as their primary language for stock market trading. And they wouldn't do that if Java was slow. I'm trying to be as patient as possible, but this is really getting out of hand. Most people in this comment thread simply have no idea what they're talking about. Specifically, look up "GOAL Lisp". Gamedevs wouldn't use Lisp if Lisp wasn't capable of providing performance comparable to C. The entire company would've died.
- TylerE 12y agoYes, I have. Lisp code with all the tweaks to even think about approaching C in speed is ugly, ugly code.
- sillysaurus3 12y agoGOAL code was many things, but "ugly" is a stretch. Jak and Dexter did more than any game of its time, and the only reason they were able to do that is because of the flexibility of the codebase. Its performance wasn't merely on par with C, but actually surpassed C in many cases. For example, they were able to stream content from disc dynamically while the game was running, and no other engine had that capability. That sounds unrelated to "performance" since it's a design decision, but in fact "performance" is everything which the end user cares about, such as load times. And the only reason the game engine performed well was Lisp. Many of Jak and Dexter's competitors didn't survive, performance problems being one of the reasons. (Game publishers used to cancel projects if development milestones aren't being met, such as a convincing tech demo. So if a tech demo was unconvincing, e.g. due to extreme performance problems, publishers basically killed the company. Maybe that's even still true as of 2015, but it was definitely true in 2001.) EDIT to your reply: You're right, I edited my comment and added a second paragraph. Also, I apologize for my earlier tone. It was uncalled for and needlessly argumentative. Sorry.
- chaitanya 12y ago> * Add your own optimizations to the compiler! > > I'm not sure here. Lisp, via compiler macros: http://www.lispworks.com/documentation/HyperSpec/Body/03_bba.htm http://www.lispworks.com/documentation/HyperSpec/Body/03_bba... > The purpose of the compiler macro facility is to permit selective source code transformations as optimization advice to the compiler. When a compound form is being processed (as by the compiler), if the operator names a compiler macro then the compiler macro function may be invoked on the form, and the resulting expansion recursively processed in preference to performing the usual processing on the original form according to its normal interpretation as a function form or macro form.
- thomasfoster96 12y agoIsn't compile-to-JS mandatory nowadays?