Why Sponsor Oils? | blog | oilshell.org
This release addresses great feedback and bug reports on OSH and Oil. It's also a checkpoint for the work "under the hood" on the garbage collector, which is now being funded by NLnet.
Oil version 0.12.4 - Source tarballs and documentation.
Here are notable changes, with credits to users who tried Oil and sent feedback.
Fixed a crash in the printf
builtin with NUL
bytes. Reported by Peter
Debelak.
NUL
bytes, but Oil shouldn't.A change from the previous release: The -i
flag to assignment builtins,
like declare -i
, is now a no-op. Docs:
Remove bare $foo
from expressions, in favor of foo
(a typed variable) or
"$foo"
(a string).
$dict['key']
and
dict['key']
. The former may be more familiar to Perl and PHP users, but
Oil uses the latter, which is more like Python and JavaScript!myvar
,
$myvar
, and
"$myvar"
?
$
as the substitution operator. So
foo
is a variable, and $foo
substitutes it into a string.Arithmetic and comparison operators now convert strings to integers.
'2' + '3'
evaluates to 5
because 2 + 3
is 5
.'22' < '3'
is false because 22 < 3
is false. That is, comparison
operators are always numeric; they don't do lexicographic comparison,
as in Python.terinjokes
for feedback on this.Fixed a few misleading error locations. They will look more like this:
if (len(42)) {
^~
'_tmp/a':1: fatal: Type error in expression: object of type 'int' has no len()
Please file a bug if you get bad or confusing errors. (This error should be more precise, but it now points to the right general location.)
Fixed translation of eggexes with literal [
or ]
. Reported by Samuel
Hierholzer.
That fix led to more fixes in class literal translation. Oil is now smart
enough to translate / [ 'a' ']' ] /
to []a]
, which is a very confusing
aspect of regex syntax!
^ - \
.Fixed incorrect caching of eggex evaluation, also found by Samuel Hierholzer. The code was too clever, and now it's a straightforward AST evaluator.
Jesse Hughes and I have been working on the C++ translation. We're merging two proofs of concept:
I also did more work on the CI and devtools:
match
statement.
Here is more detail on the issues above, and more.
#1281 | Build error for x86_64: fanos.c needs -std=c99 |
#1278 | Eggex with literal [ or ] translated incorrectly |
#1271 | Regex in a loop exits FATAL on second iteration |
#1262 | Run mycpp with a consistent Python version |
#1258 | Remove bare $foo in expression mode; it should be foo or "$foo" |
#1257 | printf crashes with NUL bytes, e.g. string `$'\U0'` |
#1247 | Get rid of old Str* layout (mylib_leaky) |
#1243 | CI should run with container version built from the repo |
#1221 | leaky bindings: get rid of Str0 and IsNulTerminated() before porting to GC |
#1118 | Missing location info |
#815 | Implement / document string <-> integer coercion rules |
Here are the commits from other contributors. You can also view the full changelog.
6198e29a | Jesse Hughes | [mycpp] Refactor/move mylib_old Str code into leaky_types (#1261) |
b9d58e13 | Jesse Hughes | [mycpp] Continue porting old Str layout to GC layout (#1263) |
019d835a | Jesse Hughes | [mycpp] Big refactoring to get rid of old Str layout (#1264) |
23bf527e | Jesse Hughes | [mycpp] Move Str out of gc_heap namespace (#1265) |
b16d5ddf | Jesse Hughes | [refactor] Big refactoring away from OLDSTL types, towards GC types (#1268) |
e06b7928 | Jesse Hughes | [mycpp] Remove ALLOCATE macro hack (#1269) |
bcaef989 | Jesse Hughes | [refactor] Remove duplicate test_str_replace (#1279) |
1e10dcbe | Jesse Hughes | [mycpp runtime] Remove OLDSTL List and consolidate code (#1282) |
Please try Oil and let me know what happens on Zulip or Github!
These metrics help me keep track of the project. Let's compare this release with the last one announced, version 0.12.0.
We've been working under the hood, so OSH didn't change that much.
I wrote new tests to cover Oil's integer arithmetic and comparison behavior, and eggex.
The performance of the oil-native parser reflects current work "under the hood". Context: #oil-dev > Two Changes That Will Decrease Perf
malloc()
instead of a bump allocator! We're preparing for
mark-and-sweep.Wall time measurements for 0.12.4:
I want to get back to bash parity, but we should get a basic garbage collector working first.
osh_eval.py
, 1680 green in C++osh_eval.py
, 1684 green in C++The size of the translated code remained the same:
The binary got unexpectedly smaller! This could be due to removing std::vector<T>
in favor of our garbage-collected List<T>
.