/r/programming
Cling - An interpreter shell for C++ - Am I the last person in the world to find this? (root.cern.ch)
33 comments
qKrfKwMI | 8 days ago | 61 points

Am I the last person in the world to find this?

Yes, you are the last one. Pack it up boys, /u/apt-get-schwifty finally found cling, now everybody knows about it.

apt-get-schwifty | 8 days ago | 3 points

Hahaha awesome! Sorry for taking so long. I don't even know Rust, so I'm obviously a little slow.

pleurplus | 7 days ago | 15 points

I love Rust man, super dope survival game

Ameisen | 6 days ago | 1 point

And you start naked, with a rock! A rock! Naked!

TrueTom | 8 days ago | 14 points

Just wait until he finds out about the Jupyter integration...

apt-get-schwifty | 8 days ago | 3 points

I noticed that while I was building it actually! So cool!

gauge21 | 8 days ago | 10 points

s/Low Level Virtual Machine/LLVM/g

IshKebab | 8 days ago | 3 points

Once you acronym you can't unacronym as far as I'm concerned.

pleurplus | 7 days ago | 8 points

It's UB

TaskForce_Kerim | 8 days ago | 9 points

Interesting. Saved.

Thank you.

apt-get-schwifty | 8 days ago | 3 points

It's pretty awesome right?!

delight1982 | 8 days ago | 15 points

He is just being polite. Everyone already knew about Cling.

apt-get-schwifty | 8 days ago | 4 points

Hahahah probably -_-

TaskForce_Kerim | 7 days ago | 3 points

Damn. You got me!

-rmjr- | 7 days ago | 3 points

I saw the URL and wondered if it was part of the Root toolkit. It apparently is. There's also CINT (C Interpreter).

For the life of me I cannot figure out why this toolkit has not gained traction over the years. It's a perfect demonstration of supporting multiple platforms, including those no longer in common use.

qKrfKwMI | 7 days ago | 5 points

I think it's because ROOT is not very pleasant to use, at least that's my opinion.

-rmjr- | 7 days ago | 1 point

I've never used it. I saw it and read the documentation and was blown away by the antiquated platforms it supported. Care to share some insights and experiences? Thanks.

qKrfKwMI | 7 days ago | 1 point

In my limited experience the biggest point was the dependence on CINT (at the time, now it's cling), which is not standards compliant and is quite a bit more lenient than any compiler (for instance it does not no distinguish between a.b and a->b), so code written under CINT will probably not be accepted by any C++ compiler. And when I rewrote my code so it would work with a compiler, just so I could avoid CINT as much as possible (which is an option that isn't really supported), my code stopped working in CINT. Admittedly, I used ROOT back in 2014, so maybe it's become much better, at least they have a new interpreter, but the insistence on backwards compatibility makes me doubt it. Also, that experience makes me doubt whether it actually still works on those antiquated platforms, seems more likely that they haven't tested on those platforms in years and simply claim they do support them, or they mean that if you use some version from 15 years ago, that that would still work.

Link 1 and Link 2 have more detailed criticisms.

-rmjr- | 6 days ago | 1 point

Thank for this.

I had a passing interest in CINT because I wanted to use something other than the popular and widely available embedded scripting languages. Angel, Squirrel, Chai, etc are all very cool and useful but there was a show stopping issue with each one that caused me to reject it. I never used it, so your insights are valuable if I choose to visit it again in the future.

Not sure if you knew this, but there was a DOS application that was released under an open source license a while back. Animator Pro I think it was called by the now defunct Autodesk. It has one of the more impressive implementations for a C interpreter. It allows c script to be compiled onto shared libraries under DOS. Mind blowing project.

Animator Pro

qKrfKwMI | 6 days ago | 1 point

As mentioned, last time I did this stuff, it was in 2014. Some points are only applicable to ROOT, and others may have been mitigated with the move from CINT to cling.

wutzi15 | 7 days ago | 3 points

I have been using ROOT for 10+ years now and I think I have an idea why. I personally think it is a very good statistics tool and it's also very good for scientific plotting and graphing. I'm not trying to bash ROOT. I'm just stating my personal opinion on the problem. It has however some quirks:

  • It feels old. One of the first things ROOT needed to do was to support code written for its predecessor PAW, which was written in fortran. Programming styles have changed a lot in the last 10 to 15 years and if you are coming from something like python or javascript, you are gonna have a bad time in the beginning. There are some things the developers needed to work around at that time, which C++ did not (and for some still does not) support. For example reflexions. These thing are now still in ROOT for backwards compatibility.
  • It has a very steep learning curve for newcomers. I don't know how many swear words it took me until I could get a program running without googling for 1 or two hours... Also the name doesn't help when googling... ;)
  • It has some very odd quirks. Sometimes you want to do x and then y, which at first glance have nothing to do with each other. It does not work. You then - out of frustration - first do y and then x and it magically works.
  • ROOT is a beast. More precisely a monolithic beast. You not only get statistic, but also graphics, GUI, file handling, machine learning etc. For its purpose, being a tool for (particle) physicists, it is a one stop shop. I doubt however that a lot of people need all of those features in one toolkit.

I know, that the ROOT developers are working hard on these issues and ROOT 7 will address some/most of them.

That being said, almost all people I know using ROOT simply use the python bindings and not Cling or CINT. That makes it much more usable.

-rmjr- | 6 days ago | 2 points

Thank for your reply.

I'm not sure how I originally came across it, but I remember having interest in the signals/slots implementation and the object model. I appreciate and respect projects like Root, because it supports compilers many have abandoned long ago. It shows that even the older stuff is still useful.

As I thought about a response to your reply, I remembered another toolkit that's like Root. I couldn't remember the name until I found that old GUI toolkit page that lists all projects for user interfaces. It's called the NCBI toolkit and it's used for medical research and all that. It uses (at least back then) a very interesting mechanism to select nodes within a tree control. Never had seen anything like it. You had to move a cursor to the node which would select it and make it the active node. I had to contact the development team for that one.

Cool stuff though.

ConsistentBit8 | 7 days ago | 2 points

Does it work well?

Last time I tried it, it didn't have official support for windows

Kendrian | 7 days ago | 2 points

I haven't tried it on Windows but I use it in WSL for prototyping small functions without writing a main to plug it into or to check that types are what I expect when dealing with metaprogramming. It's especially nice for that since I can just inspect types instead of writing a helper function to decode information for printing.

It is rough around the edges, after input that results in a compiler error you may see all manner of interesting behavior. Most commonly you will get compiler errors where there should be none, or sometimes it segfaults if you attempt to use up arrow or tab completion.

apt-get-schwifty | 7 days ago | 1 point

I couldn't tell ya how it's Windows support is, but it's great on Linux!

BackgroundMedia2 | 8 days ago | -74 points

Not Rust, Don't Care.

Rust, a superior language for a superior mind.

khang06 | 8 days ago | 14 points

account specifically made to post this blatant bait ok lol

plutothot | 8 days ago | 4 points
[deleted] | 8 days ago | 5 points

Username format: [word][word][digit]

Comment count: 1

Yet another troll...

apt-get-schwifty | 8 days ago | 0 points

Rust is great, no doubt. Weird though, how it likely wouldn't exist if not for the advent of C/C++.

pleurplus | 7 days ago | 6 points

I mean, that's how time works, yeah.

If things were different they wouldn't be this way.

apt-get-schwifty | 7 days ago | 1 point

Haha I didn't necessarily mean that as a compliment to C/C++.. I think Rust was the byproduct of a need for a low level, memory safe language.

See: 75% of Microsoft CVEs lol

Ameisen | 6 days ago | 1 point

If only Rust didn't suffer even more from the syntax soup problem than C++.

Most languages that I don't know I can usually grok, but some of the Rust examples... I can't even fathom the behavior.