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!
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
match expressions
union pattern -- multiple patterns, one RHS (match x with | X | Y _ | Z -> ...)
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
Functions, DBs and types are all referenced in the AST by name. Instead, we should refer to them by TLID. This means they won't go out of sync, they're faster to look up, and they're less likely or impossible to accidentally refer to a non-existing one. This will also mean that renaming them won't require changes to other toplevels (a key way these go out of sync)
Decide how to handle arithmetic errors (e.g. division by 0)
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!
Numbers
+
,-
,*
, etc) work on integers. In Dark v1, we useFloat::+
instead, which doesn't suck but isn't greatStrings and Chars
\n
,\r
,\t
\\
,\'
\xhh
(hex escaping)match
expressionsmatch x with | X | Y _ | Z -> ...
)Collections (Lists, Dicts, etc.)
UUIDs
Other (unorganized)
type 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: