4 ms·
It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT (https://root.cern.ch/root/html534/guides/users-guide/CINT.html h
by nneonneo 2y ago
It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT (https://root.cern.ch/root/html534/guides/users-guide/CINT.html https://root.cern.ch/root/html534/guides/users-guide/CINT.ht...) and you can have instantaneous execution and even a REPL!
- shakna 2y agoI'd prefer just using tcc [0]. Far lighter weight than that monster. And C, not C++. [0] https://bellard.org/tcc/tcc-doc.html https://bellard.org/tcc/tcc-doc.html
- maccard 2y agoGiven the idea behind this repo is to cause pain, why not add a shebang to your file [0] to make it executable. I saw a blog post a long time ago that went into the details of how ./foo worked, and how it executed an elf file. You could register `.c` programs in the same way to be compiled and run? [0] https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83a7aa4e2 https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83...
- nneonneo 2y agoNow I have a very evil idea: what about registering a binfmt handler for the header bytes “#include”? Sure, it doesn’t handle all C/C++ programs (notably any program that dares to start with a comment), but it would not require modifying any source code! (For even more insanity I guess you could also trigger on // and /*, although there’s some risk of false positives then!)
- aartaka 2y agoWell, who said that scripting language cannot be compiled? And yeah, Clang-REPL is another way to make it REPL-friendly.
- knome 2y agogenerally they aren't, as scripting usually implies an interpreter, though no one is stopping you from using a wrapping script that quietly compiles on first run and caches a bunch of executables somewhere. not much different than python producing bytecode files as it goes along.
- randomdata 2y agoScript usually implies some kind of task that runs once and the exits. As opposed to a system that is expected to run indefinitely. There are good reasons for why scripts are often interpreted and why systems are often compiled, but that's not what defines them. There are definitely scripts that are compiled and systems that are interpreted out in the wild.
- knome 2y ago'scripting' is an ill-defined term with many interpretations, certainly.
- randomdata 2y agoIf that is the case, pick another interpretation and describe to us what "non-scripting" then might be.
- knome 2y agothe original definition is likely tossing shell commands in a file to run later. chaining commands together. since perl and python supplanted this, they get lumped in as 'scripting languages'. both certainly can be used to write long running systems or short one off tasks. compiled languages are rarely used for one offs because the effort they require is usually greater than the task calls for. a big part of perl/python use is in tying together libraries written in more difficult lower level compiled languages. you'll also see scripting used to refer to languages embedded in larger projects. lua scripts to control entities in a game, for instance. do they compile these somehow? I never did in the little project I used lua for. ---- all of that together, I expect that scripting as a concept largely boils down to conceptually simpler languages with less view of the ugly underbelly of how things actually work in a computer, used to chain together abstractions created by lower level code. scripting is duct-tape. whether you duct-tape together a one-off task or some wad of long running functionality is besides the point.
- bityard 2y agoSure, there is no "rule" against it. But words/phrases have commonly-accepted meanings and willfully ignoring or appropriating those meanings implies either cultural ignorance or a concealed agenda. If you want to insist that scripting languages can be either compiled or interpreted, then its better to just drop it altogether and just say "language" because the "scripting" part has utterly lost its identity at that point.
- suzumer 2y agoCern uses cling now (https://github.com/root-project/cling https://github.com/root-project/cling)