Hacker News new | past | comments | ask | show | jobs | submit login
LLVM based Just-in-Time-Compiler for C++ (jyt.io)
135 points by entelechy on Apr 12, 2016 | hide | past | favorite | 32 comments

Cool! Is the code available anywhere? There's a couple of projects doing this and it would be good to share code. I assume this is using Clang? Do you have a list of things you'd like to see in upstream Clang? I'd imagine such a list of things would overlap quite a bit with what I or the cling folks need. If there's enough of a support base we might just be able to have upstream implement it.

Awesome, too bad that it's still in beta. I saw the screen cap and was instantly looking for the repo on their website.

Can't wait until this is finished given certain tendencies to use C++ as a scripting language...

Try https://github.com/Keno/Cxx.jl (or Cling, as someone else mentioned).

Sadly cling is a huge mess, broken links and failing build everywhere. And Cxx looks too clumsy to use and not what cling and this project seem to do.

It does actually: http://imgur.com/eN9asVz. At some point I need to get around to creating a snazzy landing page for people not coming from the julia world, but who has the time ;).

That does look a lot better, cloning now... :D


The instructions in the README should work fine to get it running. Please do let me know if they don't for you. We're planning to make it effortlessly installable with julia 0.5 once that's released, but we're not there yet.

The build process took a long time. But it works fine :). I had no problems getting it to work on

    C++ > system("uname -a");
    Linux KaliBaseVm 4.0.0-kali1-amd64 #1 SMP Debian 4.0.4-1+kali2 (2015-06-03) x86_64 GNU/Linux
So that's nice :D


Honestly I feel kinda bad about dismissing this project so quickly. It works really well, and now that I took a better look at the examples I must say that it actually looks quite elegant. I didn't understand what I was seeing at first :o

I added a screenshot to the README.

Why would I use this over Cling?

it has additional features like:

  - thread support
  - string evaluation
  - debugger
  - convenient installation
  - code reflection
In the near future it will have:

  - coroutine support
  - syntax extensions
  - assembly support
  - llvm toolchain integration
Things we currently explore:

  - modules and package managment
  - IDE-plugins
  - in-browser IDE
  - custom memory models

Awesome! And this is not just REPL. I think this software will bring up metaprogramming into a new level. We can instantiate template class at runtime (at configuration phase) and plug it into a working program. As result we get flexible runtime configuration with zero-overhead abstractions at the same time.

So it is conceptually like Cling, but "done better"? What is the license though?

This is exciting. I'm excited to see keno here too. He has been really helpful in helping get Cxx.jl working. It's awesome. Being able to interactively work on c++ and to load external dynamic libraries is really useful. Thanks for working on this I can't wait to see where this goes.

Absolutely awesome! Add tab completion and maybe syntax highlighting and it sounds pretty powerful...

One thing I'm missing in interactive interpreters is a way to save code to a file on the fly - testing things and preparing the output file in one go. Does anybody know a solution to this for, say, Python?

Do you mean like Jupyter notebooks?


Having something like this for command line would be nice.

Jupyter runs on the command line. It started out as a fancy Python REPL replacement (IPython), the notebook part has been a relatively new development.

I'm a big fan of bpython[1] for this. F10 copies current session to clipboard, F7 opens it in an external editor, and Ctrl-s saves it to a file.

[1]: https://github.com/bpython/bpython

https://root.cern.ch/ has tab completion and syntax highlighting. Also scripting support and built in reflection. It integrates with Python and R too, and you can move objects between the languages.

Use edit -p in ipython (the p is optional)

It opens your system editor and then runs the code on save. (-p opens the last edited thing from within the current ipython session)

How about the %save magic for ipython?

For example "%save mycode.py 1-10" saves the code input on lines 1 through 10 of the session to the file "mycode.py".

This has been one of the prominent use case of IPython from the start (now refactored into a language agnostic web based backend: Jupyter).

Just run it inside Emacs and you'll have a log of everything you do. In fact you could overlay C++ mode on top of shell mode and have syntax highlighting and everything.

Not for Python, but for a lua-like language: terralang.org

Is this just a REPL or can I "compile" aka run generic c++ applications faster with this?

Ceemple (now Zapcc) is doing something similar https://www.zapcc.com/

Sadly closed source.

Maybe this is already on their list, but I'd strongly encourage support for some kind of object or value introspection (a la iPython -- I know this would be difficult since it's kind like apples and oranges) as well as tab-completion pulling from that information. This is the major thing missing from Cling that prevents me from finding it really useful.

I wonder if they will support other languages that compile to LLVM. Fortran anyone? :)

Is there a "production-ready" front-end for Fortran on top of LLVM? PGI announced one but I haven't seen anything released yet.

Edit: and most of the work with this kind of project is about integrating into the Front-end, so LLVM-based or not does not really help for the amount of work to put in.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact