sci

Ingy döt Net 2024-06-28T22:47:20.630829Z

I'm getting

; Syntax error (IndexOutOfBoundsException) compiling fn* at (src/yamlscript/runtime.clj:106:1).
; Method code too large!
when I added clojure.core.async to https://github.com/yaml/yamlscript/blob/main/core/src/yamlscript/runtime.clj#L114-L129 but then if I comment out a few of the other namespace args, it is fine. I guess there's a limit here?

Ingy döt Net 2024-06-29T14:27:41.579679Z

Revisiting. My search on the message was too specific as it involved SCI. https://stackoverflow.com/a/34278743/721703 is helpful.

phronmophobic 2024-06-28T23:36:57.515649Z

I'm pretty sure this error isn't sci related. It tends to happen when you use macros to generate a ton of code in a single form like you're doing here. The fix is to split the building of the map you're passing to sci/init into separate top level forms. I think you can also split things up by wrapping things in a fn so that the clojure compiler doesn't have to generate too much code within a single method, but I don't quite remember the details. Maybe something like:

;; extra parens to call the inlined function.
( 
  (fn [] 
     ...code here...)
)

Ingy döt Net 2024-06-28T23:37:54.128319Z

Agreed and thanks. Afk for a few hours but will try after that

phronmophobic 2024-06-28T23:38:03.690759Z

searching for "Method code too large!" and clojure will probably get your more info.

Ingy döt Net 2024-06-28T23:38:52.586749Z

Yeah I actually did all the searching before I asked. Didn't really get anything interesting. But then when I commented out other parameters and it worked fine and I realized something was getting too much