Integrate gsc in gxc #834

Open
opened 2023-09-13 10:12:13 +00:00 by vyzo · 8 comments
vyzo commented 2023-09-13 10:12:13 +00:00 (Migrated from github.com)

So that the only things we install are pure gerbil.

So that the only things we install are pure gerbil.
vyzo commented 2023-09-20 06:59:11 +00:00 (Migrated from github.com)

I am having second thoughts about this, as I really like the process isolation we get from invoking gsc.

@drewc what are you thoughts about this? What do we really gain? Do we care about js code compiling anything?

I am having second thoughts about this, as I really like the process isolation we get from invoking `gsc`. @drewc what are you thoughts about this? What do we really gain? Do we care about js code compiling anything?
vyzo commented 2023-09-20 06:59:24 +00:00 (Migrated from github.com)

cc @fare as well.

cc @fare as well.
drewc commented 2023-09-21 16:52:55 +00:00 (Migrated from github.com)

We don't need to "integrate" as it were. Just to have gerbil gsc so that we do not make Gambit and/or Ghostscript uninstallable by stealing a binary name.

Also, yes, having JS code compile things is like "do we care about C code" or "do we care about python/go/Universal compiling anything". I like compilation. It adds speed! It saves memory!

I want to have gerbil is the browser. That includes compilation.

In my head making gsc into gerbil gsc solves all those problem, is future proof for all scripting languages Gambit ever supports, helps with cross compilation, has the process isolation, and is something I will do regardless so I can compile and run in the browser.

Thoughts?

We don't need to "integrate" as it were. Just to have `gerbil gsc` so that we do not make Gambit and/or Ghostscript uninstallable by stealing a binary name. Also, yes, having JS code compile things is like "do we care about C code" or "do we care about python/go/Universal compiling anything". I like compilation. It adds speed! It saves memory! I want to have gerbil is the browser. That includes compilation. In my head making `gsc` into `gerbil gsc` solves all those problem, is future proof for all scripting languages Gambit ever supports, helps with cross compilation, has the process isolation, and is something I will do regardless so I can compile and run in the browser. Thoughts?
vyzo commented 2023-09-21 17:21:49 +00:00 (Migrated from github.com)

We don't to actually include gsc in the gerbil binary; we can just compile it to js and invoke it instead of shelling out.
We can do that with some cond-expand in the driver.

We don't to actually include gsc in the gerbil binary; we can just compile it to js and invoke it instead of shelling out. We can do that with some cond-expand in the driver.
drewc commented 2023-09-21 17:36:40 +00:00 (Migrated from github.com)

I thought we have gsi included already? That means we also include gsc. If we do not then I'm so confused about what we do.

If so, we can we not redefine the one symbol difference between the two? Why add a entire other binary that conflicts with other packages and may not be needed?

My gerbil.js binary WILL do this regardless, as will .go and .py, so why not have the few line changes also be in the "C" backend as well?

Or: _gsi.scm:

;;;============================================================================

;;; File: "_gsi.scm"

;;; Copyright (c) 1994-2017 by Marc Feeley, All Rights Reserved.

(##define-macro (interpreter-or x)
  #t)

(##include "../gsi/main.scm")

;;;============================================================================

and _gsc.scm:

;;;============================================================================

;;; File: "_gsc.scm"

;;; Copyright (c) 1994-2017 by Marc Feeley, All Rights Reserved.

(##define-macro (interpreter-or x)
  x)

(##include "../gsi/main.scm")

;;;============================================================================

Do we not already do the equiv of interpreter-or by checking the command line? Why not add one more cond and be done?

Why double the size on disk and pretend it is different when it does not seem to be at all? Help! :)

I thought we have `gsi` included already? That means we also include gsc. If we do not then I'm so confused about what we do. If so, we can we not redefine the one symbol difference between the two? Why add a entire other binary that conflicts with other packages and may not be needed? My `gerbil.js` binary WILL do this regardless, as will .go and .py, so why not have the few line changes also be in the "C" backend as well? Or: _gsi.scm: ``` ;;;============================================================================ ;;; File: "_gsi.scm" ;;; Copyright (c) 1994-2017 by Marc Feeley, All Rights Reserved. (##define-macro (interpreter-or x) #t) (##include "../gsi/main.scm") ;;;============================================================================ ``` and _gsc.scm: ``` ;;;============================================================================ ;;; File: "_gsc.scm" ;;; Copyright (c) 1994-2017 by Marc Feeley, All Rights Reserved. (##define-macro (interpreter-or x) x) (##include "../gsi/main.scm") ;;;============================================================================ ``` Do we not already do the equiv of interpreter-or by checking the command line? Why not add one more `cond` and be done? Why double the size on disk and pretend it is different when it does not seem to be at all? Help! :)
vyzo commented 2023-09-21 17:44:20 +00:00 (Migrated from github.com)

we don't include gsi, we don't need it; we build our own interpreter.

we don't include gsi, we don't need it; we build our own interpreter.
vyzo commented 2023-09-21 17:45:22 +00:00 (Migrated from github.com)

so what I suggest we do for js is:

  • build gsc for js
  • add cond-expands for js target in the compiler driver to deal with pure js

We are gonna need the cond expands anyway, because the targets are different.

so what I suggest we do for js is: - build gsc for js - add cond-expands for js target in the compiler driver to deal with pure js We are gonna need the cond expands anyway, because the targets are different.
drewc commented 2023-09-21 17:47:29 +00:00 (Migrated from github.com)

Damn ... so we never use the main.scm? I'll have to look at the code.

Damn ... so we never use the main.scm? I'll have to look at the code.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mighty-gerbils/gerbil#834
No description provided.