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

Updates for Julia 1.0 #29

Open
wants to merge 4 commits into
base: julia-0.7-arrays
Choose a base branch
from

Conversation

tshort
Copy link
Collaborator

@tshort tshort commented Oct 13, 2018

No description provided.

@MikeInnes
Copy link
Owner

Great – @sjorn3 want to take a look over it?

@tshort
Copy link
Collaborator Author

tshort commented Oct 27, 2018

@sjorn3, I remember you had a blog post with an array example. Is that link still available?

@sjorn3
Copy link
Collaborator

sjorn3 commented Oct 29, 2018

Yep all of my blog stuff is still up at seaninn.es/gsoc_blog. I think the one you want is: http://seaninn.es/gsoc_blog/gsoc/2018/06/25/array-example.html

If these changes are just fixing the docos tests and updating to julia 0.7 then this looks fine to me though I haven't had a chance to test them locally. Just need to delete the comment saying it doesn't work.

@@ -439,10 +439,12 @@ end

# This doesn't work anymore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one

@tshort
Copy link
Collaborator Author

tshort commented Dec 1, 2018

While tests pass, there's still breakage on these branches. For arrays, I started to try to replicate Sean's array example in his blog entry. I can create both "wasm" and "wast" files, but both seem broken. The binary file just errors. The text file has bad entries. Here are some examples:

  (local i32) (local i32)
    (get_local 0)
    (WebAssembly.GetGlobal(13))
    (i32.gt_u)
    (if
      (then
        (WebAssembly.MemoryUtility(:current_memory, false))     ;; BAD
...
       (i32.sub)
        (WebAssembly.MemoryUtility(:grow_memory, false))    ;; BAD
        (i32.const 0)
        (i32.lt_s)
        (if
          (then
            (i32.const 0)
            (return)))
        (get_local 2)
        (i32.const 16)
        (i32.shl)
        (WebAssembly.SetGlobal(13))))   ;; BAD

@sjorn3
Copy link
Collaborator

sjorn3 commented Dec 1, 2018

I'm not sure what would be wrong with the binary off the top of my head, but definitely the issue with wast is that I never added a show instance for most of the new stuff I added, so it's just printing out the data structure. This should be simple enough to fix.

The translations should all be straight forward, for the examples you gave:

WebAssembly.GetGlobal(13) -> get_global 13
WebAssembly.SetGlobal(13) -> set_global 13
WebAssembly.MemoryUtility(:current_memory, false) -> current_memory
WebAssembly.MemoryUtility(:grow_memory, false) -> grow_memory

IIRC the bool in the memory commands was a quirk of the binary format that currently isn't used for anything.

@tshort
Copy link
Collaborator Author

tshort commented Dec 1, 2018

Thanks, Sean. I'll work on getting text to work. It still might be good to go ahead and merge this and the julia-0.7-optimise branch in WebAssembly.

@tshort
Copy link
Collaborator Author

tshort commented Dec 1, 2018

I think the wasm files are working. I must have just goofed my first attempt. @sjorn3, in trying to recreate your blog post above, I'm missing getn and setn. How do I define those, or where do I get them from?

@tshort
Copy link
Collaborator Author

tshort commented Dec 1, 2018

I can replicate your blog example up to the point where it calls setn. I tried assigning it to setindex!, but that didn't work.

@tshort
Copy link
Collaborator Author

tshort commented Dec 3, 2018

Ok to merge this and its WebAssembly counterpart?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants