You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is to organize work related to Darklang's language and interpreter.
Most of these tasks are ready to be worked on, but may require some brief discussion up first.
Interpreter work can be challenging, but fun and rewarding!
Cross-cutting
rewrite RT and the interpreter to be bytecode-based rather than AST-based
deal with concurrency/parallelism
consider ref support
update interpreter to hook into step-debugging in existing editors, via DAP
deal with JSON and integer size. Problem: when we coerce integers to/from JSON, many JSON impls do not support ints larger than 63 bits (i.e. Twitter API has "id" and "id_str" fields because sometimes the "id" is bigger than 53 bits)
relevant strategies to consider:
integer conversion into JSON should use a string if appropriate
integer conversion from JSON should always be typed, and so if there's an int it can be parsed from a stringified integer literal if appropriate
Make numeric operators reasonable
Float operators are not yet supported
Dark's operators (+, -, *, etc) work on integers. In Dark v1, we use Float::+ instead, which doesn't suck but isn't great
Non-solution: We speculated that we could use the editor to simply hide the Float:: part. However, that doesn't allow polymorphism, you can't have a library that takes numbers of any kind and (for example) sums them.
Solution: use traits to support reuse of common operators for different types
string length is currently determined in O(n) time. This value should be caches as part of the string. Using a better string impl would help solve this.
Review support of escaping
Ensure common escapes work: \n, \r, \t
escapes that are needed for the text to work: \\ ,\'
allow a specific byte: \xhh (hex escaping)
could possibly allow octal escaping too
escape sequences should be clear to the user (a different color)
escape sequences should have a clear doc explaining how it works and what the user is looking at
given a generic record type type OptionRecordWrapper<'a> = { opt: Option<'a> }, I'd expect to be able to provide the type args when creating the record with OptionRecordWrapper<Int> { opt = None } but can't
records as constants
do we have full/proper currying support? if not, that
StachuDotNet
added
the
needs-review
I plan on going through each of the issues and clarifying them -- this is to mark remaining issues
label
Feb 14, 2024
This issue is to organize work related to Darklang's language and interpreter.
Most of these tasks are ready to be worked on, but may require some brief discussion up first.
Interpreter work can be challenging, but fun and rewarding!
Cross-cutting
ref
supportNumbers
+
,-
,*
, etc) work on integers. In Dark v1, we useFloat::+
instead, which doesn't suck but isn't great1.6e-19
float)Strings and Chars
\n
,\r
,\t
\\
,\'
\xhh
(hex escaping)match
expressionsmatch x with | X | Y _ | Z -> ...
)Collections (Lists, Dicts, etc.)
UUIDs
Other (unorganized)
Byte = UInt8
, and the stdlib around it should simply point to the aliastype OptionRecordWrapper<'a> = { opt: Option<'a> }
, I'd expect to be able to provide the type args when creating the record withOptionRecordWrapper<Int> { opt = None }
but can'tThe text was updated successfully, but these errors were encountered: