purescript-native icon indicating copy to clipboard operation
purescript-native copied to clipboard

Discuss: C++-specific REPL support

Open bbarker opened this issue 5 years ago • 3 comments

My understanding is that by "No C++-specific REPL", it means there's no way to try out purescript-native in a REPL. I'll admit I haven't even used the Purescript REPL for node.js yet, but haven't had a need to as yet. However, I do have an interested in a native REPL.

What needs to be done in order to have a purescript-native REPL running, if anything? Is the existing node.js REPL a good place to start?

Thanks,

bbarker avatar Apr 04 '19 01:04 bbarker

I haven't (yet?) tried any approach to a C++ REPL for purescript-native. In the past, for an unrelated project, I experimented with a couple ways to do a C/C++/ObjC REPL based on clang/llvm. I believe I also tried cling at some point. Googling "C++ repl" just now, it looks like a couple options are out there that might be a basis for doing this – it certainly seems feasible.

As for whether the existing js repl is a good place to start, I'd say yes, but maybe more for user experience than implementation help.

If you do give it a shot, I'd be happy to help debug or provide guidance where I can.

andyarvanitis avatar Apr 04 '19 03:04 andyarvanitis

I added support for a native backend to the purs repl. The idea is to build an executable for each eval, this is essentialy the same was is done for node js. The modified purs is here https://github.com/freylax/purescript and the demonstration can be found here https://github.com/freylax/purescript-native-repl When shared objects are used one can inspect an running application with the repl, see #47 .

freylax avatar Jan 08 '20 00:01 freylax

Neat! I'll try to have a look at it sometime soon.

andyarvanitis avatar Jan 08 '20 04:01 andyarvanitis