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

Component System (version 0.2.0) #116

Merged
merged 63 commits into from
Nov 2, 2023
Merged

Component System (version 0.2.0) #116

merged 63 commits into from
Nov 2, 2023

Conversation

viega
Copy link
Contributor

@viega viega commented Oct 6, 2023

  1. Implements the component system now used in Chalk. It allows you to have modules that take parameters, done in a way where it's easy to provide an interface that requires NO code. See : Design Doc for component system chalk#30
  2. Pulls in new nimutils changes, including the new IO system, the subprocess API, etc.

WIP: Component system

Most of the first draft is done. The major exception for the component info is the treecheck code for param blocks.
I also have started a bit of the support work that needs to be done, such as removing static lock checks (the dynamic ones need to be redone still).
viega and others added 26 commits October 7, 2023 15:51
Compiling but no testing started yet
Removed Stream object in Con4mToken

Added a StrCursor object that holds Runes and can be serialized.
Polished, filling in missing pieces, and getting it to work on a test program.

The stack interface had to be massaged. All our stuff currently passes streams. And it now can take a URL instead, though I think that probably needs a tweak, as I'm not testing it yet. Should work fine in the 'use' statement though.

Also, I reworked some tiny bits in the lexer and parser related to newline handling.
- The interface for statements now has some stuff to handle a graceful statement end.
- Sections and parameters no longer REQUIRE braces.
- The pre-check phase has been combined into the post-check phase.
- Any operator tokens will always cause any following whitespace token to gobble up a newline. Meaning, you should *always* be able to add a single newline after any operator (not literal tokens, etc).
This way, they can be used as field names.
I (eventually) realized when `chalk gen` didn't work that there were plenty of cases where we'd be running two execution contexts that might share the same base code, leading to type conflicts across the execution environments. To compensate, I moved the component objects into the execution environment.

This was the quick and simple way.

Ideally, We'd centrally cache the output of parse() but either copy the tree or keep a parallel tree of sorts, to avoid too much duplication.
Added some basic bits needed to operationalize components in Chalk, such as being able to ask for parameters on the command line (see params.nim) and to parse inputs that are expected to be Con4m literals.
Note if the expected type is 'string' then we accept their entire input without quotes. Otherwise, we parse the text under the assumption it's a con4m literal.
as the url and extension are concatenated before the call to
fetchAttempt() there is no need to normalize the url again
… are special cased instead of first class tokens. Changing this broke type conversion functions
@viega viega changed the title WIP: Component System Component System Nov 2, 2023
@viega viega marked this pull request as ready for review November 2, 2023 22:03
@viega viega changed the title Component System Component System (version 0.2.0) Nov 2, 2023
@viega viega merged commit fad5f97 into main Nov 2, 2023
1 check passed
@viega viega deleted the jtv/next branch November 2, 2023 22:04
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.

2 participants