Hi Benjamin,

From what I remember, I think this feature was never properly completed. In the manual, it says:

ECMAScript <http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf> was not the first non-Schemey language implemented by Guile, but it was the first implemented for Guile’s bytecode compiler. The goal was to support ECMAScript version 3.1, a relatively small language, but the implementer was completely irresponsible and got distracted by other things before finishing the standard library, and even some bits of the syntax. So, ECMAScript does deserve a mention in the manual, but it doesn’t deserve an endorsement until its implementation is completed, perhaps by some more responsible hacker.

I tried it very briefly a while ago, and couldn't even get a fairly basic program to run. I don't know if any work on it has been done on it since then, but I haven't heard of anything.

Thanks,
James.

On 26/12/2025 17:06, Benjamin Acevedo wrote:
Hello. I see that the guile compiler supports ECMAscript, but I can't
seem to get my js programs to compile or run.

There's some info in the user manual where you can say:

```
guile --language=ecmascript -c <expression>
````

The manual says the -c flag evaluates this as a Scheme expression.

If I have a main.js file with the only contents being:

console.log('hello, world')

and say:

```
guild compile main.js
```

This is the output I get:

main.js:1:0: warning: possibly unbound variable `console.log'
main.js:1:20: warning: possibly unbound variable `world'' wrote
`/home/me/.cache/guile/ccache/3.0-LE-8-4.7/home/me/Code/js/main.js.go'

I'm using guile version 3.0.11. I just can't seem to figure out how to
compile/run javascript programs. Any help would be greatly appreciated.
Thanks so much. Please let me know if you need any additional info.

Reply via email to