[NetLogo/Tortoise/Galapagos] Configurable Extensions for NetLogo; URL Extensions for NetLogo Web #434#2508
Draft
omargfh wants to merge 5 commits into
Draft
[NetLogo/Tortoise/Galapagos] Configurable Extensions for NetLogo; URL Extensions for NetLogo Web #434#2508omargfh wants to merge 5 commits into
omargfh wants to merge 5 commits into
Conversation
extension [ <name> [url <url>]? ]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[WIP] [NetLogo/Tortoise/Galapagos] Configurable Extensions for NetLogo; URL Extensions for NetLogo Web
Branches
Specification
extensionwith the intention of allowing arbitrary modifiers to be used alongside the keyword. In practice,extensionseither loads an extension similar toextensionsor allows for aurlmodifier, which is only supported in NetLogo Web.extension [ <extensionName> [url <url literal>]? ]*extensionkeyword is dubbedConfigurableExtensionsImplementation Details
Galapagosthetortoise.coffeefile contains functions to compileNLogoandNLogoXfiles. Before compilation, and after rewrites, we extract the code from the.nlogo[x]file.The call stack from there is:1.
Galapagos:NLWExtensionsLoader.loadURLExtensions2. which calls
org.nlogo.tortoise:BroswerCompiler.listExtensions3. which calls
org.nlogo.core:FrontEnd.findAllExtensions4. which calls
org.nlogo.parse:StructureParser.findExtensionsandorg.nlogo.parse:StructureParser.findConfigurableExtensions5. which tokenizes the code and extracts the extension list
Galapagos:NLWExtensionsLoader.loadURLExtensionswhich figures out the extension module URL and primitives JSON url by changing.jsat the end of the URL to.jsonand creates a lazy loader for the module as well as fetching the primitives JSON and caching it inwindow.URLExtensionsRepo.Galapagos:NLWExtensionsLoader.getPrimitivesFromURLis exposed toorg.nlogo.tortoiseusingscala.js, which uses it to get primitives ifextURLis defined inorg.nlogo.tortoise:NLWExtensionsManager.importExtension.Current Work
NetLogo
FrontEnd:findConfigurableExtensionsandfindAllExtensionsExtensionManagerto support URL as a parameters (this throws on Desktop)Tortoise
BrowserCompiler.listExtensions(source: String)that delegates toFrontEnd.findAllExtensionsand returns a JSON[{ name: String, url: String?}].ExtensionManagerforNLWExtensionManager.Galapagos
NLWExtensionsLoaderto load URL extensions before compilationNLWExtensionsLoaderto the compilation function for.nlogoxfiles.