← Home ← Back to /g/

Thread 106408175

29 posts 12 images /g/
Anonymous No.106408175 >>106408235 >>106408505 >>106408592 >>106408733 >>106409373 >>106409643 >>106409757
are there programming languages where you can see the output immediately while typing without building/running?
GREY1 No.106408235
>>106408175 (OP)
NOT YET BRODIE.
WE GOTTA MAKE IT ALL FROM SCRATCH.
Anonymous No.106408505 >>106408527
>>106408175 (OP)
Java.
Anonymous No.106408527 >>106408541
>>106408505
come on
Anonymous No.106408541 >>106408563 >>106408664
>>106408527
Am I wrong?
Anonymous No.106408563 >>106408568
>>106408541
yes? you have to build java code to bytecode. you can't see runtime behaviour while editing.
Anonymous No.106408568 >>106408578
>>106408563
jshell nigga
Anonymous No.106408578
>>106408568
oh shit this is sick. appreciated.
Anonymous No.106408592 >>106409067
>>106408175 (OP)
That's what Lisps do with their REPL more or less (a long running process that evaluates code on the fly). Try Babashka.
Anonymous No.106408664
>>106408541
no walter, you're not wrong, you're just an asshole
Anonymous No.106408733
>>106408175 (OP)
Idk but lsp servers get pretty close. I'm currently learning C++ and I setup clangd as my lsp server in my nvim setup and it helped catch a bunch of errors before compile time
Anonymous No.106409067 >>106409147
>>106408592
this, a Lisp is an obvious choice
Common Lisp (first choice because its conditions system allows for correction of errors without annihilation of callstack, one can imagine programming a game, having a raised condition, correcting it, and resuming as you were).
Clojure for a functional Lisp on the JVM
Elixir has a good REPL too

anyway, Common Lisp would be the best option, its save-lisp-and-die feature allows for building up of software directly in the REPL and reloading later
Anonymous No.106409147 >>106409159
>>106409067
would Clang-Repl be a viable option too?
Anonymous No.106409159 >>106409204
>>106409147
no, C++ is a static language, and any REPL around it is going to be janky. Lisp REPLs are far and above other language REPLs (even things like Python),, Common Lisp in particular. if your goal is to have a language that you primarily work with via a REPL, a Lisp is pretty much your only option.
I just remembered, you could also look into a Smalltalk-esquee language, see https://pharo.org/features
Anonymous No.106409204 >>106409211 >>106409217
>>106409159
>if your goal is to have a language that you primarily work with via a REPL
use case?
Anonymous No.106409211 >>106409223
>>106409204
i just wanna edit my program while its running without rebuilding so i can rapidly prototype ideas
Anonymous No.106409217
>>106409204
you should try it out yourself
surely you are capable of forming your own opinions?
Anonymous No.106409223 >>106409279
>>106409211
do you know what hot reloading is? you don't need REPL
Anonymous No.106409279
>>106409223
that still involves applying your changes and recompiling, just on a per linked library basis. i want to edit the line and immediately see the output change in realtime.
Anonymous No.106409373 >>106409442
>>106408175 (OP)
Wolfram Mathematica programs are interactive notebooks where you can modify and re-evaluate any part as you go. I'm guessing they were the inspiration for that Python stuff. Their integration feels a lot more seamless.
Anonymous No.106409442
>>106409373
Elixir has https://livebook.dev/
probably doesn't compare to Wolfram's stuff
Anonymous No.106409454
HolyC
Anonymous No.106409633 >>106409667
slouch
https://github.com/lukechampine/slouch
demo video: https://www.youtube.com/watch?v=r99-nzGDapg
Anonymous No.106409643 >>106409667
>>106408175 (OP)
sounds expensive
what if I accidentally type out an infinitely recursive function?
Anonymous No.106409667 >>106409716
>>106409643
>what is bounded computation with preemptive threading
come on Anon
>>106409633
cool
Anonymous No.106409716 >>106409743 >>106409752
>>106409667
so you'd create a green thread with a copy of the entire program state every time the user types a valid token?
Anonymous No.106409743 >>106409752
>>106409716
no, read/write more code
Anonymous No.106409752
>>106409716
>>106409743
if you want reading material, look into Erlang's reductions mechanism, as well as methods for tracking it from an external Erlang process
Anonymous No.106409757
>>106408175 (OP)
you can find REPLs online for pretty much any language, even C