~technomancy/fennel#228: 
Parse without load

The load function is unsafe to expose to untrusted code as-is. Because of this, it's better to omit it from sandboxes. It would be best if the parser could operate without a dependency on load, but this means reimplementing escape handling.

Status
REPORTED
Submitter
~technomancy
Assigned to
No-one
Submitted
8 months ago
Updated
2 days ago
Labels
enhancement

~technomancy 8 months ago

~xerool a month ago*

I've added the aforementioned fuzzing, and also I've updated the implementation. Due to the fuzzing, I'm pretty confident the behavior is correct, so the only concern left is comparing performance.

~technomancy 2 days ago

I went to benchmark this using the test suite, and it was significantly slower. I realized that could have been due to changes to the test suite, not just changes in the implementation. So I took fennel and fennel.lua from this branch and brought it into fennel-ls, and it wouldn't compile. So I think there are still some bugs in this branch:

~/src/fennel-ls $ make test
DEV=y XDG_DATA_HOME=test/data lua fennel --add-package-path "deps/?.lua" --add-fennel-path "src/?.fnl;deps/?.fnl" test/init.fnl
src/fennel-ls/docs.fnl:42:10: Compile error: unknown identifier: lua-versions.lua53.math.fields

  (set (. lua-versions.lua53.math.fields f) (. lua-versions.lua52.math.fields f)))

~xerool 2 days ago

The branch is on an old upstream; parse-no-load is based on 1.5.0, whereas the (set (. a.b c)) syntax was fixed in one of the later 1.5.x patches. If you want I can try to rebase it onto a newer version!

Register here or Log in to comment, or comment via email.