@nickbauman re: hooks, deftype and defrecord also support java annotations.
@mobileink do you support hooks?
I’m currently using defrecord
in the defentity
macro so in theory I could use those features, but I want to underlying implementation to be free of the defrecord
macro so that if desired, the user can choose to forgo the defentity
macro and work with pure maps.
Does that make any sense, mobileink ?
you want to associate callbacks with entities?
@nickbauman my reading of the cb api is you don't need to do that.
right you just register them.
But I don’t want to rely on defrecord
I’m thinking of just using genclass
what's the advantage of gen-class? it's useless if you don't aot. I'm not sure since I haven't implemented yet, but I suspect you could just provide some sample code demonstrating the use of deftype. I don't think it needs to be part of your api/dsl. just guessing.
I’m confused. I thought the javadocs said that an annotation is required to support hooks.
I’m pretty sure everything going up on appengine requires full AOT
yes, it's the annotation that make a method a callback. no, it is not the case that "everything" must be at compiled. only the servlets and filters.
having said that, I'm not sure about callbacks, not having implemented them. I'm assuming they only need the annotation, not aot. I could be wrong on that.
iow, you only have to aot compile the stubs, not the clojure code that implements you business logic. when the servlet container calls a method in your stub, the gen-class code forward the call to your clojure code. this is explained in a little more detail at https://github.com/migae/boot-gae. the did is relatively extensive but not very well organized. working on it.
goddammit I hate android spell check, which continually rewrites my text into sth illiterate.
lol
I wasn’t aware that you can compile at runtime on AE at all?
I wonder if writing the callbacks in pure clojure would be easier lol
Not even using their crappy annotations.
well, define "compile". clojure compiles, always. it's not an interpreter. aot compilation just puts the byte code on disk, which the servlet container needs in order to find and load.
IN java you have to use annotation to do what’s trivial in Clojure because Java is too crude.
Right OK
check out the "servlets" task in migae. it reads an end file that contains servlet specs, generates a clojure source file with a gen-class for each servlet, aot compiles it, then discards it. the app code need only implement the service method for each servlet - in clojure.
huh
reads an edn file, not end.
right
so boot-migae depends critically on the boot task pipeline; i can do all that stuff independently. not sure how feasible that is with leinengen.
callbacks in pure clojure: looks doable to me. servlet container needs web.xml plus on-disk bytexode to find and load servlets. ds callbacks need only annotations. this is an appengine datastore convention, the servlet container need not be involved - i think. when the appengine runtime goes to call a callback, does it need to find it on disk? doubt it but dunno.