News for hackers. Stuff that matters.
Re:Swift as a C Language REPL by pjmlp on Thursday January 02, 2020 @05:09AM (#21934142)
GDB can be used as C language REPL since at least late 90's, and lldb as well.

And if their pseudo-REPL features aren't enough, there are a couple of C interpreters to choose from.

http://www.softintegration.com/

https://gitlab.com/zsaleeba/picoc

https://root.cern.ch/cling

Re:Swift as a C Language REPL by ufo on Thursday January 02, 2020 @09:41AM (#21935661)
What would I have to do to use gdb as a C repl? I'm not very familiar with gdb other than using the backtrace to debug segmentation faults.
Re:Swift as a C Language REPL by pjmlp on Thursday January 02, 2020 @10:03AM (#21935863)
Compile your executable with debug info, and then make use of gdb expressions.

https://sourceware.org/gdb/current/onlinedocs/gdb/Expression...

It is not fully featured REPL, don't expect to use it to create stuff on the fly, it is more to query and call existing code.

For a proper REPL, check one of the listed interpreters.

Re:Swift as a C Language REPL by rowanG077 on Saturday January 04, 2020 @05:17PM (#21957990)
So what you are saying that it's not actually a C REPL. It's a GDB expression REPL which is very different. What was the original point of your comment?
Re:Swift as a C Language REPL by mlthoughts2018 on Thursday January 02, 2020 @07:02AM (#21934699)
CPython is my personal favorite C language REPL.