Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello WebAssembly! (MVP implementation) #10870

Merged
merged 48 commits into from
Mar 21, 2022
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cabdb42
Add Wasm32 LibC (based on musl)
lbguilherme Jul 1, 2021
76d5e22
Add Basic Wasm32 support
lbguilherme Jul 1, 2021
98c5447
Add LibC as a symbolic link
lbguilherme Jul 1, 2021
94109db
Merge branch 'master' into feat/webassembly
lbguilherme Jul 14, 2021
fa5077a
Move wasm to a Crystal::System implementation
lbguilherme Jul 14, 2021
fe511de
Enable smoke tests for wasm32-wasi
lbguilherme Jul 14, 2021
165b974
Revert change on unix Thread
lbguilherme Jul 14, 2021
be594ed
Smoke test: build compiler for the wasm test
lbguilherme Jul 14, 2021
ffe4b5b
Merge remote-tracking branch 'upstream/master' into feat/webassembly
lbguilherme Jul 20, 2021
598c99f
Mark stub methods with NotImplementedError or TODO
lbguilherme Jul 21, 2021
2d78c9b
Update src/crystal/system/wasm/process.cr
lbguilherme Jul 21, 2021
ffd9c12
Update wasi libc: it's now limited to what wasi actually provides. Mo…
lbguilherme Jul 22, 2021
9faf715
Use arc4random instead of getentropy
lbguilherme Jul 22, 2021
b0797c1
Remove Signal, Process and Sockets unimplemented method from Wasm32
lbguilherme Aug 2, 2021
aec74ad
Work around compiler bug in previous commit: BUG: `typeof(_io)` at ex…
lbguilherme Aug 2, 2021
463d4cd
fix: cleanup from previous commit
lbguilherme Aug 2, 2021
5faf601
Merge remote-tracking branch 'upstream/master' into feat/webassembly
lbguilherme Aug 2, 2021
3d91387
Merge remote-tracking branch 'upstream/master' into feat/webassembly
lbguilherme Aug 3, 2021
b1dd5f7
crystal tool format
lbguilherme Aug 3, 2021
00b10d6
fix: use correct .wasm extension
lbguilherme Dec 18, 2021
eab4739
Merge remote-tracking branch 'upstream/master' into feat/webassembly
lbguilherme Dec 18, 2021
4e33d92
Merge remote-tracking branch 'upstream/master' into feat/webassembly
lbguilherme Dec 23, 2021
e86b675
feat: implement Crystal::System::Fiber with malloc/free
lbguilherme Dec 23, 2021
ba5a531
fix: mark system_linger as not implemented
lbguilherme Dec 24, 2021
2582817
feat: add direct wasi integration for Dir.entries
lbguilherme Dec 24, 2021
4d5b061
feat: enable libpcre
lbguilherme Dec 24, 2021
5b4627f
chore: refactor Crystal::Program.object_extension
lbguilherme Dec 28, 2021
2519a6a
fix: mock Thread.current
lbguilherme Dec 28, 2021
fdef3ac
chore: change PREOPENS to @@preopens
lbguilherme Dec 28, 2021
10c6eb7
fix: print fatal errors
lbguilherme Dec 28, 2021
a0407ca
fix: use Sync logger until channels work
lbguilherme Dec 28, 2021
c3f035f
chore: rename wasierror.cr -> wasi_error.cr
lbguilherme Dec 28, 2021
3ba1b96
chore: preopen cleanup
lbguilherme Dec 28, 2021
e58cf26
fix: there is no need to initialize PREOPENS as early as possible if …
lbguilherme Dec 29, 2021
7bcd75a
fix: missing wasi require
lbguilherme Dec 29, 2021
cb2ea23
feat: generate better linker command
lbguilherme Dec 29, 2021
ad2e402
chore: stub Exception::CallStack#decode_backtrace until callback support
lbguilherme Dec 29, 2021
2e4b517
chore: remove some unused pieces from wasm libc
lbguilherme Dec 31, 2021
5faa13a
fix: use "out fd"
lbguilherme Jan 27, 2022
9de1150
feat: add wasi random_get to avoid relying on arc4random polyfill
lbguilherme Feb 8, 2022
2d3158e
Mark WASI as a UNIX target and use it as the system environment, inst…
lbguilherme Feb 8, 2022
ac74bad
Update spec/compiler/loader/unix_spec.cr
lbguilherme Feb 8, 2022
9f72ef9
Update spec/compiler/ffi/ffi_spec.cr
lbguilherme Feb 8, 2022
fea289a
Revert "Update spec/compiler/loader/unix_spec.cr"
lbguilherme Feb 8, 2022
53f6c25
Revert "Update spec/compiler/ffi/ffi_spec.cr"
lbguilherme Feb 8, 2022
5995375
fix: correct usage of some wasm32<->wasi flags
lbguilherme Feb 8, 2022
570eb32
Merge remote-tracking branch 'upstream/master' into feat/webassembly
lbguilherme Feb 11, 2022
b011761
fix: home_path for wasi
lbguilherme Feb 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: implement Crystal::System::Fiber with malloc/free
  • Loading branch information
lbguilherme committed Dec 23, 2021
commit e86b675311304ba6a31c919c9f7c26adf62e3df2
4 changes: 2 additions & 2 deletions src/crystal/system/wasm/fiber.cr
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@ require "c/sys/mman"

module Crystal::System::Fiber
def self.allocate_stack(stack_size) : Void*
raise NotImplementedError.new("Crystal::System::Fiber.allocate_stack")
LibC.malloc(stack_size)
end

def self.free_stack(stack : Void*, stack_size) : Nil
raise NotImplementedError.new("Crystal::System::Fiber.free_stack")
LibC.free(stack)
end
end