Commit Graph

263 Commits

Author SHA1 Message Date
078b443185 Add a repeat keyword 2024-11-03 12:20:53 -05:00
92a593b80f Support reductions for comparison operators like == and < 2024-11-02 22:34:35 -04:00
0b7a0dd043 Change reducers to use (OP: ...) syntax and return an optional value 2024-11-02 20:22:19 -04:00
9ebb039a81 Fix up some GCC compiler flag options for LTO and inlining 2024-10-29 23:14:31 -04:00
63a5032ca0 Disallow mutation of read-only views 2024-10-27 20:35:30 -04:00
41c0ea851a Deprecate "&" for stack references 2024-10-27 20:35:12 -04:00
67702b2d77 Fix issue with non-ID chars in filenames 2024-10-10 01:09:17 -04:00
074cf22ad4 Change function syntax from func(args)->ret to func(args -> ret) 2024-10-09 13:26:28 -04:00
d741763293 Disallow reductions over tables (use .keys or .values instead) 2024-10-08 23:28:20 -04:00
37192d7206 Support reductions over sets 2024-10-08 23:26:49 -04:00
839c1983a0 Reduce padding needed for optional types and clean up some redundant
type padding
2024-10-08 21:10:36 -04:00
6b9055db7c Deprecate readonly pointers for now 2024-10-04 13:21:56 -04:00
8f346b48aa Fix up some compiler flags around floating point numbers so they work
better with -Ofast and have more standardized behavior
2024-10-03 14:19:23 -04:00
ec0606091b Add datetime literal and tests 2024-09-30 13:55:55 -04:00
076f87361d Support using DateTime() as a constructor 2024-09-29 20:19:46 -04:00
ca93e6f3cb Simplify code by making name := use ... a Use AST instead of a Declare 2024-09-27 14:56:24 -04:00
ed8b8901c0 Add '$' prefix on all user code 2024-09-24 14:54:22 -04:00
800e386105 Rename from_unsafe_text to without_escaping 2024-09-24 13:26:49 -04:00
0609a26f31 Fix type promotion for :divided_by() and :scaled_by() metamethods 2024-09-24 13:17:44 -04:00
62745cda95 Use original folder names more 2024-09-22 15:07:44 -04:00
7f5af625e5 Support useing .c files and .S files (assembly) 2024-09-18 15:39:22 -04:00
7e0b1a3214 Deprecate linker directives 2024-09-18 00:43:13 -04:00
fead0cad82 Remove dead code 2024-09-18 00:30:55 -04:00
ec88848f6b Support explicit discards better by allowing multiple declared "_" vars 2024-09-18 00:30:05 -04:00
aaa51fc734 Perform topological ordering when compiling typedefs so users don't need
to think about ordering their definitions.
2024-09-17 15:17:13 -04:00
de49bc5bb3 Deprecate :or_else()/:or_fail()/:or_exit() in favor of the or operator 2024-09-16 16:06:19 -04:00
821bde156c Support (optional or skip) 2024-09-16 15:48:06 -04:00
6b5a9d65e3 Overhaul of how libraries are installed 2024-09-15 21:18:42 -04:00
835eb7e896 Add optional:or_exit(...) 2024-09-15 16:42:42 -04:00
fb37b0ee42 Fix up if var := ...: in ternary expressions and optional checking
logic
2024-09-15 16:29:45 -04:00
e422079fcc Add a Byte datatype 2024-09-15 15:33:47 -04:00
c455e7b67d Rename builtins/ -> stdlib/ 2024-09-13 20:18:08 -04:00
34c562e88e Move cord helper functions into their own file 2024-09-13 14:23:24 -04:00
d094049f81 Fix bug in logic for detecting constant strings 2024-09-13 02:02:30 -04:00
46a2aa2ffc Fix up comprehensions so set comprehensions work and everything is a bit
more clean
2024-09-12 14:27:13 -04:00
327d466b95 Table:get() now uses optional values instead of default or failure modes 2024-09-12 00:55:43 -04:00
fa7e52787f Add postfix ! operator for optionals 2024-09-12 00:13:53 -04:00
c034175ae1 Add optional:or_else(fallback) and optional:or_fail(message) 2024-09-11 23:17:03 -04:00
3443edf760 Use optionals for iterators 2024-09-11 22:28:43 -04:00
f7ff82913f Fix recursive structs with optionals 2024-09-11 15:20:33 -04:00
db0d5a1c20 Change *:from_text() methods to return optional values and set up CLI
parsing to use that approach
2024-09-11 14:53:48 -04:00
b0b23acf88 Rename "Nil"->"Null" for consistency 2024-09-11 13:55:41 -04:00
210179ee67 Optional enums (deprecated custom tag values) 2024-09-11 12:29:48 -04:00
23209a0aab Use optional ints in the array find()/first() API 2024-09-11 01:39:19 -04:00
7126755275 Add optional types 2024-09-11 01:31:31 -04:00
f86cc6549f Bugfixes 2024-09-08 19:33:49 -04:00
aeed1992e9 Fix nearly every GCC warning and add __attribute__((pure/const)) where
appropriate
2024-09-08 17:17:15 -04:00
11fa4f548c Support 'when' statements as expressions 2024-09-06 14:15:55 -04:00
7239ec4083 Bugfixes for lambdas that have a trailing abort statement (and print
statements aren't those)
2024-09-06 12:33:28 -04:00
c075deeab4 Actual fix for incref issue 2024-09-06 04:14:50 -04:00
391c1b6bde Rename table_t -> Table_t 2024-09-05 14:57:31 -04:00
fa5ca582ff Clean up some imports 2024-09-05 02:37:45 -04:00
d1b2e9f598 Disallow 'use' statements that aren't top level 2024-09-04 13:48:26 -04:00
29a87ff325 Support literal Text("blah") for text that is constant ASCII strings 2024-09-03 14:48:54 -04:00
6d7a359f8f Bugfix some text replacement things 2024-09-02 19:49:52 -04:00
61e482f6f3 Initial WIP first past 2024-09-02 18:47:39 -04:00
dceb925573 Bugfix for parsing ints 2024-08-23 11:38:54 -04:00
ad51b208b4 Overhaul of import syntax. Now everything uses use: use foo, `use
./foo.tm`, `use <foo.h>`, `use libfoo.so`
2024-08-22 14:02:48 -04:00
2055439be4 Variables can no longer hold function pointers, only closure_t's. This
makes error reporting easier and prevents issues where some functions
could be assigned, but not others. Also change outputs so Void returns
don't show up when displaying types, now just: `func()`
2024-08-21 00:49:22 -04:00
3c4f477b84 Bugfix some copy-on-write cases for when pointers are automatically
derefenced for method calls
2024-08-20 16:20:41 -04:00
3ce239760e Remove TODO 2024-08-19 19:17:01 -04:00
934b843b1c Add .text_content as a field on DSLs instead of a method 2024-08-19 14:29:58 -04:00
3ddaf92505 Bugfix :text_content() for DSLs 2024-08-19 13:21:28 -04:00
9e07c6adc7 Add Channel:peek() 2024-08-18 23:31:36 -04:00
2e8c949fdc Rename push/pop to give/get, since it's not stack-ordered 2024-08-18 23:24:23 -04:00
7472837ee5 Add array:first(predicate:func(x:&T)->Bool)->@%T? 2024-08-18 22:28:04 -04:00
967b649da2 Deprecate # operator in favor of .length and fix up some issues 2024-08-18 20:39:57 -04:00
f4b04a1b8c Improved syntax for dollar-string literals 2024-08-18 14:44:15 -04:00
da4d07c665 Fix up some bigint logic issues 2024-08-18 12:47:29 -04:00
752ab8212c Split BigIntType out of IntType and switch to using enums for the size
of ints/nums
2024-08-18 11:49:51 -04:00
de31398fe4 Add table:get_or_null(key) for tables with non-null pointer values,
which lets get() keep the non-null return type
2024-08-17 15:01:01 -04:00
2d3c114435 Check for compile-time constant integers that require heap allocations. 2024-08-16 02:29:07 -04:00
6d24438509 More helpful error message for table indexing 2024-08-15 14:52:41 -04:00
688f883e16 Add array:find() 2024-08-15 03:01:04 -04:00
66ae30ac29 Add method for array:remove_item(item) and rename
array:remove(index)->array:remove_at(index) to avoid confusion. Also
hook up array:has()
2024-08-15 02:39:35 -04:00
ed1667cb37 Add array:shuffled() and checks for array insertion 2024-08-15 02:17:53 -04:00
eccc4e4721 Add binary search method to arrays 2024-08-15 01:59:42 -04:00
e0223a4c20 Support ^ exponentiation for integers 2024-08-13 16:32:00 -04:00
d08f795794 Partially working first draft of bigints 2024-08-13 01:30:25 -04:00
ea80fefa05 Bugfix some issues with table keys/values 2024-08-12 17:57:14 -04:00
2ecb5fe885 Add channels and threads 2024-08-11 14:47:34 -04:00
6d3d104363 Overhaul of operator metamethods 2024-08-10 20:50:15 -04:00
948d6b4c22 Add array:counts() 2024-08-10 16:36:50 -04:00
4265728cbb Add Array:unique() to get a set of unique items 2024-08-10 16:19:36 -04:00
b37bd70b60 For tables, deprecate support for square bracket indexing and .default
values, replacing them with a `:bump()` function for tables with numeric
values. This means that counters can be implemented easily without the
need to mask complexity.
2024-08-10 16:03:41 -04:00
8d3d591312 Add Sets to the language 2024-08-10 15:15:38 -04:00
ff4ea60daf Tweaks to array implementation, including changing how the bits are
allocated, making more explicit checks for refcounts and max values,
optimizations for certain methods, and adding compile-time errors for
arrays that hold items that are too large.
2024-08-04 14:22:58 -04:00
adccc56880 Switch around some of the logic for array:random() and array:shuffle()
to use Int$random() and return values
2024-08-04 13:03:55 -04:00
09204f4ce8 Revert "Fix array:random() to return a random item using correct RNG logic,"
This reverts commit 68b34cf00b.
2024-08-03 17:44:22 -04:00
8357d02992 Make default table removal behavior deterministic, but have caches
explicitly use random eviction.
2024-08-03 17:42:45 -04:00
68b34cf00b Fix array:random() to return a random item using correct RNG logic,
rather than a reference.
2024-08-03 17:33:18 -04:00
b2e752ee32 Replace heap_str with GC_strdup 2024-07-26 13:30:24 -04:00
cfe46ee393 Replace heap_strn() with GC_strndup() 2024-07-26 13:28:18 -04:00
fb95bbb1d4 Deprecate array:pairs() and switch iterator functions to use enums 2024-07-20 16:45:13 -04:00
907122a049 Fix for unqualified enum names as return values 2024-07-19 14:16:51 -04:00
9fec3a6adb Fix for reductions over iterators like (+) range(5, 10) 2024-07-13 19:58:21 -04:00
39576466a7 Add ReturnType(ret) so we can more accurately track return values for
`if` statements
2024-07-13 18:43:50 -04:00
2e2f68e582 Allow lambdas to have a return statement as the last statement 2024-07-13 18:26:41 -04:00
f64aaf5960 Add array:pairs() 2024-07-13 18:05:14 -04:00
445f79cb70 Add iterator functions 2024-07-13 17:17:58 -04:00