Skip to content

Implement explicit resource management#1458

Merged
saghul merged 1 commit into
masterfrom
explicit-resource-management
May 16, 2026
Merged

Implement explicit resource management#1458
saghul merged 1 commit into
masterfrom
explicit-resource-management

Conversation

@saghul
Copy link
Copy Markdown
Contributor

@saghul saghul commented Apr 22, 2026

Co-authored-by: Ben Noordhuis info@bnoordhuis.nl

Closes: #865

@saghul saghul force-pushed the explicit-resource-management branch 2 times, most recently from 42bc792 to 4fdbe0e Compare April 22, 2026 11:46
Copy link
Copy Markdown
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1700 lines is more than I have time to review in-depth at the moment. I'll trust your good judgement.

Comment thread quickjs-opcode.h Outdated
@saghul saghul mentioned this pull request May 5, 2026
@houd1ni
Copy link
Copy Markdown

houd1ni commented May 5, 2026

Could you please share some good merged PR or a commit with similar stuff added to compare for better understanding ? ❤️

@saghul
Copy link
Copy Markdown
Contributor Author

saghul commented May 5, 2026

Not sure what you mean, can you rephrase?

This is the implementation itself, there is no other.

Ben made an inception PR but it didn't include the new syntax.

This PR implements the entire spec.

@houd1ni
Copy link
Copy Markdown

houd1ni commented May 5, 2026

can you rephrase?

I mean not about this exact spec, but another apriori well implemented. for keywords for or const or something like that where one can see the entire pipeline from keyword register in ast (like here) to its implementation itself. if nothing comes in mind, nevermind - I just found the implementation almost got it already. new noob questions:

  • what are gen/* sources ? (they misled me in the search of impl itself in the commit)
  • why one large source quickjs.c ? to avoid using Make or what ? I've been using sqlite, and the onefile-approach has been used for ease of amalgamation, and they generate it afaik.

@saghul
Copy link
Copy Markdown
Contributor Author

saghul commented May 7, 2026

  • what are gen/* sources ? (they misled me in the search of impl itself in the commit)

That is generated bytecode that we embed in the engine and or CLI. Some builtins are written in JS, and we generate the bytecode and embed it.

Likewise, for the CLI, the REPL is written is JS and is embedded the same way.

  • why one large source quickjs.c ? to avoid using Make or what ? I've been using sqlite, and the onefile-approach has been used for ease of amalgamation, and they generate it afaik.

That is how the original project was writtern and after some debate (you can search around the old isses) we decided to keep it.

Personally, I didn't like it at first but I don't mind it anymore :-)

Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>

Closes: #865
@saghul saghul force-pushed the explicit-resource-management branch from 4fdbe0e to 9ec1734 Compare May 16, 2026 22:15
@saghul saghul marked this pull request as ready for review May 16, 2026 22:15
@saghul saghul merged commit 440883b into master May 16, 2026
124 checks passed
@saghul saghul deleted the explicit-resource-management branch May 16, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants