Coder Social home page Coder Social logo

REPL in exported App about arcadia HOT 13 OPEN

arcadia-unity avatar arcadia-unity commented on July 23, 2024
REPL in exported App

from arcadia.

Comments (13)

jeaye avatar jeaye commented on July 23, 2024

This would be amazing; has there been any work done for it?

from arcadia.

nasser avatar nasser commented on July 23, 2024

It is theoretically possible on some platforms, but we have not had a chance to try it yet. Short answer: it should work on exported desktop games, probably won't ever work on mobile or consoles.

Long answer: some export platforms disallow runtime code emission, i.e. the generation of new executable code while a program is running. This is done for security reasons and happens on the kernel level, so we can't sidestep it. We've confirmed this to be the case on iOS, the web and the PS4, but it probably applies to all mobile and console targets as well.

A Clojure REPL emits code when it compiles and executes forms, so an exported REPL on these platforms will never be possible given the current compiler architecture. This limitation is also what makes exporting normal Clojure code to these platforms difficult, as the compiler uses optimizations that modify the bytecode at runtime, which is also rejected by these platforms for the same reason.

from arcadia.

nasser avatar nasser commented on July 23, 2024

Confirmed working on desktop and Android! Just need to clean it up a bit. It will be in the first alpha.

from arcadia.

jeaye avatar jeaye commented on July 23, 2024

from arcadia.

nasser avatar nasser commented on July 23, 2024

Yeah! We've learned not to trust what we read and just build things. Unity doesn't AOT anything for Android, it seems. We have export and a REPL on the device.

from arcadia.

jeaye avatar jeaye commented on July 23, 2024

from arcadia.

selfsame avatar selfsame commented on July 23, 2024

maybe this issue should include:

  • fixing up arcadia.repl to be a buildable ns
  • fixing android export (currently you have to manually AOT your project and copy to build?)

from arcadia.

nasser avatar nasser commented on July 23, 2024
  • arcadia.repl is very close, its really our config story thats still something of a mess and editor dependent
  • android export should Just Work, but only clojure.core, arcadia.core and the namespaces of vars on your hooks (and their requires) will be automatically AOT'd. If you want more namespaces to show up in the exported app, you need to :require them or manually AOT them.

from arcadia.

spacepluk avatar spacepluk commented on July 23, 2024

I think reader conditionals would help a lot with this. Maybe we can map Unity's #define directives to arcadia specific keywords like :unity-editor, :unity-android, etc.

from arcadia.

selfsame avatar selfsame commented on July 23, 2024

ah ok wasn't sure if the android build aot stuff had been fixed or not.

reader conditionals for build target/editor would be very cool, or at the least some sort of ns meta like in #184 (comment)

from arcadia.

spacepluk avatar spacepluk commented on July 23, 2024

About the android export, I'm not sure if this is a linux-specific issue but in my case BuildPostProcess was running after the apk was sent to the device which wasn't very useful. So I ended up deleting BuildPostProcess.cs and AOTing some namespaces manually.

from arcadia.

nasser avatar nasser commented on July 23, 2024

That's a limitation of Unity's export hooks. It seems to run them after it uploads the apk. What I've done is hit Build then upload the apk myself.

from arcadia.

timsgardner avatar timsgardner commented on July 23, 2024
  •  disentangle config
  •  use main-thread-callback (or whatever) ns for driver
  •  make main-thread-callback ns easily externally drivable from the main thread by a variety of mechanisms (including export-amenable ones) and have it test that it's running on the main thread

from arcadia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.