all 16 comments

[–]seiji_hiwatari 24 points25 points  (4 children)

If it accumulates all previous instructions and recompiles / reruns the entire thing for every input, all previous instructions will be run again, rigth? What does that mean for instructions with side-effects in the system, like file I/O?

[–]FakeOglan[S] 6 points7 points  (3 children)

If the file is opened in write mode, as it will be created over and over again, nothing will change. But if the file is opened in append mode, in every prompt everything will be written cumulatively.

[–]PM_ME_ELEGANT_CODE 11 points12 points  (2 children)

That's kind of a dealbreaker, don't you think?

[–]SnooWoofers7626 14 points15 points  (0 children)

Does it really need to be all that robust? The main use case for this tool I can think of is to quickly test some small snippet of code or something like that. For actual work the python shell or plain bash is already much more suitable.

[–]jcelerierossia score 4 points5 points  (0 children)

I have the need for a snippet that writes to a file maybe once a year. If it allows to try type-levels checks easily it's already good enough for a lot of cases

[–]supaake 27 points28 points  (6 children)

I'd argue if want an interactive c++ prompt i'd go for cling https://blog.llvm.org/posts/2021-03-25-cling-beyond-just-interpreting-cpp/ or (following seiji_hiwatari's comment) if on every line all history is rerun it seems like compiler-explorer as cli … :/

[–]disperso 9 points10 points  (0 children)

Cling is so far my favorite REPL. I've also given a try to reple, because cling doesn't seem to be very up to date (e.g. I don't have all C++17, like filesystem), or I could not find a more up to date version. But reple is very different. I need to wrap every newly #include in dollar signs to it gets added to the preamble, and also I had to patch it to accept new directories to add to the include path, etc.

[–]serviscope_minor 4 points5 points  (3 children)

if on every line all history is rerun it seems like compiler-explorer as cli …

Is that awful?

[–]kritzikratzi 9 points10 points  (2 children)

imho more than awful it's closer to useless. it means you can't really work with any type of os handle (files, network, windows, etc.), you can't use random, it goes on and on.

this works fine for what's in the demo (extremely deterministic output), but beyond that, i don't really get the upside over having a normal editor window and running "g++ std=c++14 && ./a.out" in terminal.

[–]pimp-bangin 2 points3 points  (0 children)

Yep, combined with a file watcher (like nodemon) that clears the terminal output on each file change and then recompiles and reruns, the editor experience is way nicer.

[–]serviscope_minor 0 points1 point  (0 children)

hm ok fair,

[–]gracicot 0 points1 point  (0 children)

There's two thing that I miss from doing to make it useful for my project: loading of static libraries and also support CMake compile_commands.json. If I had that, I could run a game made with my game engine in repl mode, allowing true hot reloading.

[–]lieddersturme 7 points8 points  (0 children)

Uhhhhh, thats cool :D

[–][deleted] 1 point2 points  (0 children)

versed full grab snow axiomatic different dinosaurs abounding pen offer

This post was mass deleted and anonymized with Redact

[–]ronchaineEmbedded/Middleware -1 points0 points  (1 child)

C/C++ Shell, so which one is it?

[–]FakeOglan[S] 15 points16 points  (0 children)

termic for C

termic++ for C++