Swift as a C Language REPL
medium.com
Swift as a C Language REPL
1–10 of 24 posts
Re: Swift as a C Language REPL
#2And if their pseudo-REPL features aren't enough, there are a couple of C interpreters to choose from.
http://www.softintegration.com/
Re: Swift as a C Language REPL
#3GDB 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
#4https://github.com/solidsnack/CLibPQ/blob/master/module.modu...
Once you've mapped in the library, trying it out interactively in Swift is easy and fun because of Swift's high-level features.
Re: Swift as a C Language REPL
#5Incidentally, the Swift REPL itself has another nasty misfeature: it always outputs the fully introspected debug representation of complex values, rather than calling `description`/`debugDescription` where available. Not really an issue when working with pointers, but for native structs and classes with complex internal state it can print screens and screens of unreadable noise, totally defeating the purpose. Conversely, the GUI-based “Swift Playgrounds” REPL prints line output right but lacks the CLI’s persistency so re-evaluates all lines every time a new line is entered, making it useless for stateful work.
TL;DR: Swift’s a hairy mess. [paraphrased jwz aphorism goes here]
Re: Swift as a C Language REPL
#6Re: Swift as a C Language REPL
#7GDB 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
#8Re: Swift as a C Language REPL
#9GDB 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
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.
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.