<mwette>did you mean 'value instead of 'bytecode? : (compile '(+ 1 2) #:from 'scheme #:to 'value) <mwette>((compile '(lambda () 9) #:from 'scheme #:to 'value)) => 9 <alextee[m]>mwette: I'm trying to get bytecode as lilyp said so i can run it with scm_call_0(bytecode) <alextee[m]>so eventually I could do `:from 'otherlang` or something to support other languages too <mwette>I think you want "value" instead of "bytecode". Try it. <alextee[m]>I think it doesn't like that I'm passing the script as a string <alextee[m]>I'm not sure how to pass a script as the first argument to (compile) <mwette>Script needs to be a literal, I think. For strings you can use scm_eval_string. And I think you can change the urrent-language: (current-language 'ecmascript) <alextee[m]>oh I think I need to use scm_call_* to call eval-string otherwise I can't pass the current language <alextee[m]>seems like scm_eval_string() only takes a scheme string *alextee[m] attempts to call eval-string <singpolyma>compile-file is best if you have a file. Otherwise eval-string yeah <singpolyma>You can compile-file to 'value and it's actually eval not compile <alextee[m]>they seem to do the same thing, I have both a file and the contents so either is fine <alextee[m]>I don't understand which argument is problematic from that error message <alextee[m]>I'm trying with a test string "(display \"hello\")" for now <alextee[m]>I think scheme is missing the quote from what I can see there, what is the C API to get 'scheme instead of just scheme? <alextee[m]>i thought it was scm_from_utf8_symbol() but that doesn't seem to do it <alextee[m]>this works with guile -s: (eval-string "(display \"hello\")" #:lang 'scheme) <alextee[m]>just can't reproduce this call with that C code it seems <alextee[m]>SCM eval_string_proc = scm_variable_ref (scm_c_public_lookup ("ice-9 eval-string", "eval-string")); SCM code = scm_from_utf8_string ("(display \"hello\")"); SCM s_from_lang = scm_from_utf8_symbol ("scheme"); SCM kwd_lang = scm_from_utf8_keyword ("lang"); scm_call_3 (eval_string_proc, code, kwd_lang, s_from_lang); <alextee[m]>well it looks like it can evaluate javascript now but I'm not sure how to use the exported modules from it lol <alextee[m]>or even how to print stuff like (display). console seems undefined <alextee[m]>anyway thanks for the help! at least I can easily choose a language in the future now that it's just a string in my code <singpolyma>alextee[m]: oh, do you have questions about guile ecmascript <alextee[m]>singpolyma: is it possible to include those modules and use them as ecmascript functions too? ^ <singpolyma>`var blah = require("some.scheme.module"); blah["some-proc"]();` <singpolyma>Where the dots go where the spaces would to use module from scheme <alextee[m]>er ignore the "hello" that was from the previous invocation <singpolyma>If you have other questions about guile ecmascript I'm usually here and AFAIK know more than easily most people about it :) <singpolyma>I should really write something for the manual about it, but haven't yet <alextee[m]>singpolyma: neat! i saw in the manual that it said ECMAscript support needs a lot of work, is that still true? is it incomplete in some way? <singpolyma>Uh. Well, it could use some love, but it depends on your goals <alextee[m]>also, does guile have a way to auto-detect the language of the script so I don't have to add a dropdown to select? <alextee[m]>I mean it's mostly just invocations of my API so it should be fine.. unless the user wants to do some complex javascripty stuff <singpolyma>The APIs are mostly the guile APIs with very few things to make it look like say the node stdlib <singpolyma>So, it's a very valid ecmascript but if you call it "JavaScript" a node dev can't "just use it" for anything very big without learning <singpolyma>I think there are some proposals/patches around about racket style #lang or extension based support, but I don't have a link on me <alextee[m]>guile APIs and my own modules are more than enough to accomplish most things I guess, sounds good enough <singpolyma>BTW, if you haven't seen them there are also out of tree lua and python for guile. I have played with the Lua a bit not the python yet <singpolyma>The Lua is a bit buggier than the ecmascript, but it's usable <alextee[m]>would I have to compile guile myself with specific flags to enable those? <singpolyma>Nope. Just include the modules for Lua in the guile load path <alextee[m]>i can't really find any info how to do that XD will need some handholding to try it <alextee[m]>but ecmascript and scheme are more than enough until python/lua are fully baked <alextee[m]>I'll add a drop down between "elisp" "scheme" and "ecmascript" for now <alextee[m]>hmm i wonder if there's a way to introspect available modules ***sneek_ is now known as sneek
<mwette>(use-modules (system base compile)) (add-lang-extension "py" 'python) <mwette>then files that end in .py or file w/ first line "#lang python" should use that langauge (when installed); not confident it is robust <drakonis>maybe it'll soon be time to rebrand guile as a language oriented programming language? <lilyp>language oriented programming <lilyp>programming oriented programming <lilyp>We did it, we solved programming :) <ft>Took us long enough. :) ***jackhill is now known as KM4MBG
***KM4MBG is now known as jackhill
<spk121>meta-objects, macros & programming oriented programming: MOM & POP <mwette>spk121: building guile-gi; in gi-gtkdoc.scm I think (let ((f (tmpnam))) (mkdir f) ...) should be (let ((f (mkdtemp "/tmp/guile-gi-XXXXXX"))) ...) as tmpnam will be deprecated soon (I build guile with --disable-tmpnam) ***sneek_ is now known as sneek