Replies: 2 comments 7 replies
-
Sorry, at the moment this is obviously an area that Koka lacks good tooling. I've been successful in debugging some things by setting up lldb in vscode to use the compiled C code output directory, so at least I can put breakpoints in the C functions across all of the dependencies. Part of the issue is that the transpiled C code breaks up functions at every potential effectful call, which duplicates a bunch of code and makes it so that you have to insert many breakpoints which would otherwise be a single spot in Koka's source. I read a paper recently which presents a "simple" way to add debugging / lldb support for higher level languages that compile to C. https://github.com/BuildIt-lang/d2x Obviously Koka is intended to be a sound language. So it should never segfault, other than if you run out of stack (a common occurrence unfortunately, due to the many small functions that get built up as continuations). I think it should be recommended to always make sure you set your terminal / process settings to have unlimited stack. This usually solves issues developers have encountered with segfaulting in Koka. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I swore C had stack overflows, I must've simply misremembered. I appreciate the patience too. |
Beta Was this translation helpful? Give feedback.
-
I'm in the midst of trying to understand why a program of mine is currently segfaulting (I figure I probably can't fix it, but at least avoid it), and I'm having a hard time trying to use lldb to debug the program.
Problem is that all that I got (If I'm right about this, which I may not) is the transpiled C code to put up breakpoints and take a stack trace at the moment of segfaulting.
Is there an lldb plugin that allows me to see koka code instead of the C code, or any other way of debugging other than just putting a bunch of
println
s everywhere to debug this?Beta Was this translation helpful? Give feedback.
All reactions