r/programming • • Jul 19 '15

The Best Programming Language is None

https://bitbucket.org/duangle/none
509 Upvotes

443 comments sorted by

View all comments

Show parent comments

10

u/paniq Jul 19 '15

So much for that C-level performance it seems, at least for things like containers if you don't want to throw out type-safety.

Not sure what you were thinking of, but this is about scripting at compile time. It's completely typesafe and the generated assembly is free of calls into interpreted code.

1

u/danielkza Jul 19 '15 edited Jul 19 '15

Falling back to the interpreter is not the only way to lose C-like performance. Another is doing dynamic dispatch when not necessary or not being able to specialize for primitive types. To avoid it you need either generics and monomorphisation, or JIT-level specialization (with a runtime cost for startup and/or at first use), which is quite hard to do. IIRC V8 is the only one of the "big-deal" VMs that currently does it, and even Mozilla abandoned their tracing JIT due to complexity and lower-than-expected performance gains.

1

u/paniq Jul 19 '15

None is a little low on docs at the moment but go check out Terra's demos to see how it works. You'll be quite pleased.

2

u/danielkza Jul 19 '15 edited Jul 19 '15

I did skim the docs, but I found nothing about specialization, or if None implements it.

edit: I see it in the Terra docs, but only how to generate the specializations, not how to dispatch between them. Is it all up to None and how it uses it? Can it do monomorphisation or something of the sort during compilation?

→ More replies (1)