~pluffie

Krasnodar Krai, Russia


#19 Working on types 9 months ago

Comment by ~pluffie on ~xerool/fennel-ls

Debugger is done.

Although I named it fnldbg, it actually work with Fennel as bad as debugger.lua does. Mangling is still a problem. Backtraces are still a problem if you are working with compiled code. I am fixing this right now.

Anyway, I'll continue working on type checker tomorrow.

#204 Strange read behaviour 9 months ago

Comment by ~pluffie on ~technomancy/fennel

Sounds reasonable.

Maybe at least add indication that the following input will be consumed by the command? Something like

>> ,doc
.. ,doc

#19 Working on types 9 months ago

Comment by ~pluffie on ~xerool/fennel-ls

~xerool, I saw it, but I think it can't remote debug. Debugging language server with remote debugger is much easier than with regular one.

By the way, I've almost done writing it.

#204 Strange read behaviour 9 months ago

Ticket created by ~pluffie on ~technomancy/fennel

>> ,doc
>> ,doc
(unquote doc) not found

It's not just a ,doc problem. Actually, it's a problem with read function passed to the commands.

I first encountered it when I was developing debugger. I added ,step command which can be used both with or without arguments, but when I tried to use it without arguments, repl gone crazy.

I assume that the actual problem is that the read function just can't read empty string.

#19 Working on types 9 months ago

Comment by ~pluffie on ~xerool/fennel-ls

#Current state - WIP

Todos:

  • Return type of and isn't informative at all. Make it more informative.
  • Return type of or also isn't informative. See src/fennel-ls/typecheck.fnl:144.
  • Add some warnings for redundant code found using type information (for example, (= a b), where a and b have different type, is always false)
  • Extend . and : types to catch errors with invalid fields and have meaningful return type. See src/fennel-ls/typechecker.fnl:184.
  • Add type information for more builtins.
  • Add function argument type resolving.
  • Add function type annotations.
  • Dependent typing (at least basic).

Help welcomed. If someone want to help then I can publish existing code.

I've postponed the development. Debugging language servers is painful, especially if most of the code isn't yours. Currently I am writing debugger for Fennel to make development way easier.

#19 Working on types 9 months ago

Ticket created by ~pluffie on ~xerool/fennel-ls

Recently I started work on implementing type checker. I will use this ticket for implementation status reports and type checker related discussions.

#203 Embeding metadata in more places 9 months ago

Comment by ~pluffie on ~technomancy/fennel

Okay, maybe then just add a way to attach metadata to any expression only at compile time? Something like "compile metadata". This kind of metadata wouldn't be accessible at runtime, so it can be stored in AST and ignored when generating Lua. As far as I know, plugins should be able to access it.

EDIT: compile metadata is like a pragma but attached to AST node

#203 Embeding metadata in more places 9 months ago

Comment by ~pluffie on ~technomancy/fennel

Right, the problem is where would they be attached to?

Maybe change mangling so that it guarantees that all identifiers in the output are different and then use them as keys? It would solve problem with assigning metadata to arbitrary identifiers.

#203 Embeding metadata in more places 9 months ago

Comment by ~pluffie on ~technomancy/fennel

Okay, this implementation actually makes sense if all metadata is stored in one huge table.

#203 Embeding metadata in more places 9 months ago

Comment by ~pluffie on ~technomancy/fennel

In the Clojure example

It's Fennel but with Clojure-like metadata annotations.

a) any time anyone looked up 42 (whether it was "your" 42 or somewhere completely unrelated in the program) they would get the metadata you tried to attach to answer and b) you would overwrite whatever was previously stored there.

Umm, it makes sense but at the same time it doesn't. Why is metadata attached to values? Why such a weird implementation? Is it impossible to attach metadata to declarations or something?