carp-lang / Carp

A statically typed lisp, without a GC, for real-time applications.
Apache License 2.0
5.47k stars 173 forks source link

Repl :t command doesn't work with (use) #1460

Open ekzhang opened 7 months ago

ekzhang commented 7 months ago

I think the REPL's :t command doesn't quite work as I would expect with namespaces that are opened!

Here's the output on carp-v0.5.5-x86_64-macos:

鲤 :t IO.read-file
=> (Fn [(Ref String <a>)] (Result String String) <StaticLifetime>)
鲤 (use IO)
鲤 :t read-file
I can’t find the symbol `read-file` at REPL:5:7.

Traceback:
  (type read-file) at REPL:5:1.

This is despite that I can otherwise call (read-file) directly after (use IO) works. The same happens in composition when I type use IO:

鲤 use IO
=> IO
鲤 :t (read-file "input")
Can't get the type of: (read-file "input") at REPL:2:7.

Traceback:
  (type (read-file "input")) at REPL:2:1.
鲤 :t (IO.read-file "input")
=> (Result String String)

But not with (use IO) — I'm not sure what the difference is here.

鲤 (use IO)
鲤 :t (read-file "input")
=> (Result String String)
鲤 :t (IO.read-file "input")
=> (Result String String)
KoltPenny commented 3 months ago

Is this project dead?

eriksvedang commented 3 months ago

@KoltPenny Hi, I wouldn't say that it's dead but it's very much on the back burner right now.

I'm the head maintainer of the project, and I'm currently working on a (commercial) game project (https://www.eriksvedang.com/2024/02/26/announcing-manahex.html), with more in the pipeline. I hope to be able to take the time off to work on "Carp 2.0" sometime in the future. Such a project was started, using LLVM, and it showed much promise but didn't reach feature parity with what's in this repo, and is thuse kept private for now. Until more active work is resumed, it seems unlikely that the project here will progress much. Feel free to try it out though, any feedback is appreciated! Even PRs could be interesting, as long as they're not too large.

Cheers, Erik

KoltPenny commented 3 months ago

@eriksvedang Thanks! Your new game looks great btw.