Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider NodeJS compiler instead of bootsrapping #278

Open
jcubic opened this issue Jan 19, 2024 · 0 comments
Open

Consider NodeJS compiler instead of bootsrapping #278

jcubic opened this issue Jan 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jcubic
Copy link
Collaborator

jcubic commented Jan 19, 2024

Simple script is very slow.

This file:

(define-syntax foo
  (syntax-rules ()
    ((foo)
     (begin
       (define x 32)
       (print x)))))
(foo)

Executes:

real    0m0.520s
user    0m1.044s
sys     0m0.126s

But removing dependency on Scheme libraries and disabling bootstrapping:

(define (print x)
  (display x)
  (display "\n"))

(define foo
  (syntax-rules ()
    ((foo)
     (begin
       (define x 32)
       (print x)))))
(foo)

executes much faster:

real	0m0,176s
user	0m0,188s
sys	0m0,082s

A thing to consider to speed things up, create a compiler that will check what symbols were used and include that in an output file that will be saved next to the source file. This will speed up execution next time the script is executed.

It will be something like Guile or Python is doing.

Note that it's not a real compiler only something similar to .xcb files that are created to speed up parsing time.

@jcubic jcubic changed the title Consider NodeJS compiler instead of boostrapping Consider NodeJS compiler instead of bootsrapping Jan 22, 2024
@jcubic jcubic added the enhancement New feature or request label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant