This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # arachne (1)
- # aws-lambda (50)
- # beginners (10)
- # boot (59)
- # capetown (4)
- # cider (9)
- # cljsjs (27)
- # clojure (249)
- # clojure-berlin (8)
- # clojure-finland (7)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-nl (7)
- # clojure-russia (91)
- # clojure-spec (100)
- # clojure-uk (61)
- # clojureremote (2)
- # clojurescript (171)
- # core-async (11)
- # cursive (31)
- # data-science (1)
- # datascript (2)
- # datomic (11)
- # dirac (2)
- # emacs (16)
- # events (1)
- # hoplon (142)
- # juxt (4)
- # lein-figwheel (9)
- # leiningen (10)
- # luminus (7)
- # lumo (44)
- # mount (3)
- # off-topic (150)
- # om (18)
- # onyx (5)
- # perun (12)
- # planck (12)
- # protorepl (13)
- # re-frame (28)
- # reagent (8)
- # ring (1)
- # ring-swagger (10)
- # spacemacs (2)
- # specter (11)
- # sql (14)
- # untangled (99)
- # vim (18)
- # yada (2)
My app runs extensive Podcast Alexa app. The hardest part is the lack of an easy workflow.
I also started with cljs-lambda, and got a basic Lambda function deployed on Amazon - but I don't know how to call the Alexa code, as I'm brand new to ClojureScript
I didn’t use any of the SDK stuff. Alexa sends you JSON. You parse it and return JSON, it works like a charm. If you want to host it yourself on your own server the SDK has some security libraries that would be handy - but if you are using Lambda they don’t require all that..
Give this a gander https://gist.github.com/jreighley/b6d394d0efa743292bf32d776be97682
Troubleshooting the lambda alexa apps is a bit tricky. The cloudwatch logs usually give you more detail than the Skills kit test app does- Printing to the console log is helpful. those show up in cloudwatch.. The workflow just stinks - because there isn’t much escaping the need to compile/upload/test..
fingertoe: fwiw, with boot-ask you can test your speechlet locally using gae devserver. once everything is copacetic, you can switch to aws-lambda without changing your code.
Regarding troubleshooting - yep is a bit of a pain, but once the basic thing works, it is possible to test locally to check that certain input returns the correct output at least
Good deal! I would like to set up a lein template or something for that — I am a pretty new developer, and have never done something like that - but I think it might be time..
The “Listen for this and say that” troubleshooting is pretty easy in your REPL it’s the “listen for this, Poke and prod a foreign API and reply with the results” gets a little hairy. What works on the REPL doesn’t aways work the same on Lambda..
Yeah, Clojurescript is partially my thing so I don't have to keep up with the 5 changes a week js ecosystem
see https://github.com/migae/boot-ask. warning: not battle-tested. you'd be a beta tester. feedback warmly welcomed. also, clojure, not clojurescript.
one thing i need to document for noobs: in the examples at https://github.com/migae/boot-ask-examples, notice`gae.boot` and
lambda.boot. copy the one you want to 'build.boot'.
gae.boot for local testing (using upload.sh, suitably edited), and then cp
build.boot when i'm ready to upload and test on aws lambda.
@mobileink That runs java, not Node, right? You have to poke it to evade the warm up time?
@fingertoe: because i am a pedant, I'll quote the great Knuth: premature optimization is the root of all evil.
so fwiw, a goal of boot-ask is to optimize programming. on the theory that stuff like startup times can always be dealt with later. it's an orthogonal consideration. (of course, i do not have any sites up that need fast startup, but who's counting?)
anyway, there are always tradeoffs. startup time is just one consideration. once you're started, i'm guessing, java is much faster. but that's just a guess.
I think running Alexa skills on your own server with Java would be the ideal setup — Nodejs on Lambda is plenty fast for most things you would use Alexa for.. I did my app with NodeJS to evade startup time issues.. Haven’t tried it the other way - but that was my worry.
simple example: you can always present a fast static splash page while your servlets are starting up. by the time your user clicks, the stuff is up and ready. point being there are many optimization techniques, but they should not be allowed to leak into code.
@fingertoe : yeah. if you run your own speechlet server you are totally in control. fwiw when i have run speechlets on gae the first time thru is a problem. but then you just say "Alexa... " again and all is fine. and this is with no optimizations at all.
I am pretty happy with how the my Clojurescript Alexa app turned out— It responds immediately the first time every time. I would prefer to have a framework like the boot-ask though - that looks mighty cool.
fwiw i am not anti-clojurescript, just do not have much experience with it. and node etc. give me the heebie-jeebies.
I will take a look. I put together a gist last night https://gist.github.com/jreighley/b6d394d0efa743292bf32d776be97682— Mine works using https://github.com/nervous-systems/cljs-lambda
ok, cljs-lambda is on my list. next time i have time to work on boot-ask i'll take axlong look. thanks
There was plenty of pain — I have never done and Node or JS… Mostly just annoyances though.. cljs-http didn’t work on node, so I had to do all my stuff with js interop etc..
but my unsolicited advice is to spend some serious time looking into boot. i love leinengen, but it must be said that boot is in an entirely different league.
Sadly, i've gotten to the point where i don't even look at projects that start out with leiningen.
I have quite tempted by boot for quite some time. The truth is that I don’t really have a good grasp on either, but lein is what I have already used, and usually I am more focused on my problem than my tools.. I am sure I will make the jump soon enough .;-)
@mobileink I read an article recently about JVM vs Node startup times and memory usage on Amazon Lambda - unsurprisingly JVM had slower startup, and required much more memory, but once running was faster (can't find the article now, will have another look). Thing is, I was doing the Alexa thing as a hobby project, something I might use from time to time, but not a professional project I expected many to use . The infrequent hits, would definitely make startup time more critical, and also JVM at suggested RAM of 512 makes it more expensive. So that was really my motivation for wanting to use ClojureScript - even though I'm unfamiliar with ClojureScript & JS & Node.