36 ms·
Evil ML: ML to C++ template language
- dunkelheit 11y agoNeat hack :) Actually whenever I need to do some C++ template metaprogramming I first imagine a functional program that would perform the task and then translate it into templates. Turns out it is much easier than starting with templates directly!
- dman 11y agoThat is a neat hack - I will try this out soon.
- vvanders 11y agoOh god, I don't even want to think about the compile times.
- eigenbom 11y agoThen just think of the run times instead.
- nickpsecurity 11y agoIn my LISP/C/C++ system I referenced, I was able to largely eliminate compile times by doing the development in LISP until it was correct and batching overnight an extraction to C/C++ w/ compilation and tests. So, if it's done right, it should be faster to iterate than a C++ tool even on older hardware. Don't do a lot of work with the ML's or this tool so I can't remember if they have the interactive option or at a good speed.
- jlarocco 11y agoLooks neat, but I can't get it to compile. I get hundreds of warnings about interfaces existing in multiple locations, and then finally an error that module Location is defined in src/location.cmx and ocamlcommon.cmxa.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- Rexxar 11y agoNice but I will nitpick a little: - double underscores at the beginning of names are reserved for compiler/STL. - Using a namespace instead of "__ml_" seems more appropriate.
- srean 11y agoIf ML and C++ excites you, don't miss out on Felix. http://felix-Lang.org http://felix-Lang.org You will get more out of it if ML excites you more than C++, rather it is the possibility of talking to C++ with minimal or no glue that excites you. It wont be totally wrong to say that it is to C++ what F# is to C#, or perhaps little more accurately Scala to Java. It is plenty fast too. A toy brainfuck interpreter written in it turned out to be speedier than C++, D, Go, but got beaten by an interpreter written in nim. Can post the link once I get off the phone. EDIT: Here it is https://github.com/kostya/benchmarks/blob/master/README.md#benchb https://github.com/kostya/benchmarks/blob/master/README.md#b... Something I find interesting is that it has had fibres and coroutines long before go was a thing. The author(not me) used it in his projects on telco switches.
- nickpsecurity 11y agoAn interesting language. I'd like it if their performance charts had numbers on them instead of just the shapes. Leaves me guessing more than knowing.
- srean 11y agoPerformance charts on the website ? I had no idea even those where there on the website :) Could you post the link please. BTW the website is running on web-server written in Felix and the entire live install image can be browsed online.
- nickpsecurity 11y agohttp://felix-lang.org/speed/perf.fdoc http://felix-lang.org/speed/perf.fdoc
- srean 11y agoThat's the shootout benchmark codes, right ? Are you seeing charts there too ?! The website caches aggressively so it could be that I am seeing stale data. Let me check. Edit: Ah! they are here http://felix-lang.org/speed/ http://felix-lang.org/speed/ in their individual directories
- nickpsecurity 11y agoThat's pretty cool. A long time ago, I had a mock-up of C/C++ in LISP that let me use LISP macro's instead of C++'s metaprogramming. A generator produced C/C++ from it when I was done with the algorithm. Much automation of boilerplate, portability, security, etc w/ some 4GL-style stuff for productivity and LISP's incremental (per function) compilation. Miss that tool. Anyway, just mentioning it because it's best of two worlds and someone else might want to re-create the concept. I saw one person do something similar for C just for interactive development. However, my old toolkit showed it could do a lot more. Some bright people could probably take it way further than what I did.
- zubairsaif007 11y agohttp://googler700.blogspot.com/ http://googler700.blogspot.com/