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

Add initial implementation of artichoke-web gem #34

Merged
merged 2 commits into from
Nov 11, 2019
Merged

Conversation

lopopolo
Copy link
Member

This gem exports Artichoke::Web::Window and Artichoke::Web::Location. Together, these enable the following program, a quine, on the playground:

# frozen_string_literal: true

require 'uri'
require 'artichoke/web'

# This program is a quine built
# using Artichoke Ruby.
#
# The quine executes Rust, Ruby, and
# JavaScript with the URL as storage.

storage = Artichoke::Web::Window.location
program = storage.hash
deserialized = URI.decode(program)

puts deserialized

This PR reorganizes the crate into modules now that main has gotten too big.

This gem allows accessing window.location.hash from Ruby in
the playground.
The addition of the web gem module means that main is too big.
- Break extern functions into ffi module.
- Break interpreter state and wrapper into interpreter module.
@lopopolo lopopolo added C-enhancement Category: New feature or request. A-gems Area: Support for rubygems in the playground. labels Nov 11, 2019
@lopopolo lopopolo merged commit 3c9e598 into master Nov 11, 2019
@lopopolo lopopolo deleted the window-location branch November 11, 2019 00:55
@lopopolo
Copy link
Member Author

lopopolo commented Dec 5, 2020

This was a kind of rubygem. See #6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-gems Area: Support for rubygems in the playground. C-enhancement Category: New feature or request.
Development

Successfully merging this pull request may close these issues.

1 participant