This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-12
Channels
- # admin-announcements (1)
- # aleph (1)
- # arachne (10)
- # beginners (6)
- # boot (81)
- # braveandtrue (3)
- # cider (42)
- # cljs-dev (1)
- # cljs-edn (52)
- # cljsjs (9)
- # cljsrn (9)
- # clojure (62)
- # clojure-austin (1)
- # clojure-belgium (11)
- # clojure-berlin (2)
- # clojure-gamedev (2)
- # clojure-greece (1)
- # clojure-russia (73)
- # clojure-uk (98)
- # clojurescript (156)
- # community-development (4)
- # component (3)
- # cursive (30)
- # datascript (10)
- # datomic (17)
- # emacs (5)
- # events (1)
- # hoplon (315)
- # jobs (1)
- # jobs-discuss (3)
- # lein-figwheel (6)
- # luminus (18)
- # off-topic (13)
- # om (130)
- # other-languages (122)
- # re-frame (32)
- # reagent (27)
- # rethinkdb (6)
- # ring (2)
- # ring-swagger (31)
- # spacemacs (4)
- # untangled (6)
- # yada (30)
@devn didn't know about Electron. I think Hoplon targets browser apps. Don't know if it is possible to decently interface with js lib for desktop apps.
Did you know about https://github.com/Gonzih/cljs-electron
@micha @piotrek it doesn't answer your question but today I needed to reuse rpc fn, passing message-cells as params.
like so
(defn conj-db! [success-cell error-cell process-cell]
(mkremote 'app.api/conj-db!
success-cell error-cell process-cell))
And then I call it in a hl page, "closure style"
(defc form-send-success nil)
(defc form-send-error nil)
(defc form-send-process [])
((rpc/conj-db!
form-send-success
form-send-error
form-send-process)
form-data)
Untested, but that was what I had in mind
So I can reuse rpc for multiple pages, each of which have their own message-cells
Again untested
((get-widget-data result-cell errors-cell loading-cell) date-from date-to)
@alandipert: thanks! actually, making information go in two directions is something i might need a hand with later
@alandipert: also, not sure if you remember, but you gave me this snippet ages ago to help me get up and running on heroku
(deftask build-heroku-war
"Build a war for deployment"
[]
(comp
(hoplon)
(cljs :optimizations :advanced)
(prerender)
(uber :as-jars true)
(web :serve 'app.handler/app)
(war)
(target :dir #{"target_prod"})))
how do I get that to use http-kit?
apparently that is needed for sente to work
this is what my local dev looks like
(comp
(watch)
(serve
:port 8000
:handler 'app.handler/app
:init 'app.network.core/start-router!
:cleanup 'app.network.core/stop-router!
:httpkit true)
(speak)
(hoplon)
(reload)
(cljs)
(target :dir #{"target_dev"})))
@micha that navy video is cool, i think @meeli might start using it in a training course she runs on FE development (she already mentions hoplon )
@alandipert: mostly, i noticed that the web
task doesn’t take the same parameters as the serve
task
the war file is the servlet part that is loaded into a servlet container like jetty or tomcat
if you want to run http-kit i think you'll need to deploy an uberjar or something like that, not a war file
this navy computer video is incredibly well produced
these animations and illustrations are so much better than the powerpoint garbage of today
the concept of making a continuous computer out of gears, also awesome
no need to settle on your number system or endianness
unitless values
that's true, or if negative is even a thing lol
i guess also you need to scale it to the bounds of your inputs
it's like a nomogram in this way
it's sweet the way training videos break down the concept into themes
like The Working Surface
like aspects of the problem relevant to the domain
so you have perfect working vocab for this subset of things about gears
oh cool
functional form = jig
i was thinking in the language itself though
mostly machinery to support the very limited machine that solves the problem
well like if you want to build a really complicated machine, like the navy targeting computer
right
unfortunately because it's cheap to store and ship the software they make us change it in place all the time
true, then the machinists are the ones who really have to figure it out
yeah, seriously, like someone just says “make this reciprocal curve"
and that’s the spec
seems like a legit way to work though, somebody needs to cut the problem down into smaller more attackable problems
satisfying to think about
@micha i think i just need to know more about how java works
@micha @alandipert helped me gloss over that bit when i first got setup
this is what heroku is doing
java $JAVA_OPTS -jar webapp-runner.jar ${WEBAPP_RUNNER_OPTS:-"--expand-war"} --port $PORT ./target_prod/project.war
@thedavidmeister: so you can make a uberjar and just run it like that, no?
we made an app like this for work, i'll share relevant parts
the build.boot. the build
task makes an executable jar, the main class of which is sinmara.main-class
https://gist.github.com/alandipert/2a8ea734cf0e8a013e949620791a01d4
main class is basically stub that exists just to be AOT'd. all it does is call sinmara.run/-main
https://gist.github.com/alandipert/bcea48dc2eb0e3502d4b5566180ecb0e
i guess webapp-runner is something heroku does
¯\(ツ)/¯
sinmara.run is where we actually start the web app using run-jetty
. this is where you'd start your app to run with http-kit - https://gist.github.com/alandipert/a2326dd6fe669a4ca4f00e316eb39a8f
oooh ok
so to build for deployment you do boot build
which makes target/project.jar
so i have a server thing that is running my code for me
and to run in prod do java -jar target/project.jar
but i want my code to run a server thing inside it
i think so, yeah
basically you want your program to be the entrypoint
not the web server they provide
yeah, that would give me a lot more control
i think this is achievable with a Procfile or something but my heroku is rusty
that would have made zero sense to me when i was first getting setup, lol
hehe yes
welcome to the java world, all shenanigans all the time
i think owning the entrypoint is the way of the future, in this age of virtualization
i definitely feel like a lot of this would make more sense if i had a java background
web app containers etc existed kind of because they didn't have docker or VMs imo
yeah, where do you guys normally host your stuff?
i’m getting one of the guys at work into clojure
and he’s been messing around with docker
also war files were good for enterprise things where they needed to have like a multi tenant thing
oh yuck
yeah, that’s no my goal
yeah coconut VMs
straight AWS is pretty “raw"
i found docker great for local dev, but i'm :thumbsdown: for deploying to it
or otherwise relying on it in prod
docker compose is esp. awesome for local dev
why bad for production?
we have VMs already to virtualize unix environments
they don't come up as quickly as docker containers, but then most apps don't restart constantly
sticking with VM also removes a debugging layer that can get pretty hairy
yeah, at work we use vagrant, with a new environment for each branch
getting it up and down fast is pretty critical there
so we will probably move to docker at some point
if you use vagrant to build images then it starts to compete with docker for startup time probly
that's what we're moving toward at work, with chef anyway
we rebake our images each night automatically
using our legacy chef things to build images, that we then deploy from
cool, yeah
then send the images to the devs using btsync
if they have to build the environment from scratch each time it’s very slow, like 20m
oh, so this is for devs tho
so :thumbsup: docker then
but if they just pull up an image it’s like 4m
yeah, well we set all this up when docker was pretty new
seems like moving to docker for this would be pretty straightforward
yes, but it’s a matter of priorities, not whether we can/can’t do it 🙂
ahah yes i know that feel
atm we’re focussing on automating our workflows more
like, reporting, reminders, merge conflict resolution, release management, etc.
well, for my side projects, i like to have a service that isn’t sudo
style setup on linux boxes
more time tinkering on the application layer, less time managing the environment 🙂
so @alandipert you wouldn’t want to use something like https://www.tutum.co/?
i would for a side project or experiment
but for anything i need to maintain for months or years it needs to be no magic
since i'm going to end up building my own infrastructure regardless
haha, i think of it more like “outsourcing” rather than “magic” 😛
better to build around stable elements than layer magic
the time spent figuring out how to reverse engineer their stupid scripts is time you could spend just studying the underlying thing
that’s fine to say if you’re the one doing the understanding
but at some point, there will be people in the business who don’t understand
it’s not foolish, it’s reality
you hire a new person
on day 1 they don’t understand everything
from a business standpoint, it's scary to build infrastructure on any platform that hasn't existed for very long, as the platform is subject to acquisition/shutdown/heavy change
this is another point for AWS
that’s true
they are excellent at managing change so far and aren't going anywher
if your people don't understand the platform and instead of studying that add layers of cruft on top of it, that's not good for business
it’s not just understanding though
what if you need to have certain SLAs that are 24/7 but you aren’t in a place to have a team on call 24/7
you might need to start offloading some risk
for example
yes :thumbsdown: to the sales guy who made that deal lol
haha, yes
"oh yeah bro we have people on call 24/7 no sweat"
but there’s always grey areas
i mean i have acquaintances
who crapped out some ruby on rails thing, hosted on heroku for free, and sold the business for 100k a few months later
clearly they are winning
so it's definitely not that expedient magical platforms are always bad
that sounds pretty great actually
aha you can't
magical people such as these can't be hired
as long as you can reproduce that magic
realistically, you want to “cofound” with them i think 😉
there just isn't an easy way to make these decisions i don'tthink
depends on the team, the business, etc
it really does
then i realized that the time i spent studying that could be spent doing something "productive"
i just know personally that if i'm going to be involved with something that i want it to succeed, and to do that i will need full access
i don't want to log in to some web console to right click on something to make go
yeah, but there is a cost to the full access bit
the cost is you can't hire as many idiots
oh man, i’ve never seen anyone have a good time with chef...
so hiring gets harder
the cost is also your time as well
time is hard to manage
it is, but i'd call that cost an investment
vs time learning magical things which is a gamble
sure, it is an investment
and every investment has an opportunity cost vs. other investments 😛
true, since you can usually start applying instantly
also, it’s not really fair to say that everyone who doesn’t know AWS inside out is an idiot
you won’t get a very diverse team with that approach 😞
like adding tools on top of AWS doesn't solve the problem of not knowing how anything the tools are using works
that’s true
but we’re building our own tools to help automate tasks
also i didn't mean to imply that about people who don't know AWS
it’s not that much different in one sense
i think ultimately, i’d prefer to just have something reasonably portable, and frequently re-assess the situation
and move if it makes sense to
hah, i think probably 2 weeks to get setup
but more if you want to get into security and change management
another example from work
like 2 yrs ago i needed to stand up a new app
so i went with easy & fast, an AWS service called elastic beanstalk
which AWS built on top of many of their own services using dozens of shell scripts and some web console
the stuff they added on top made it easy and fast to get running
but debugging, monitoring, scaling all were very difficult as a result
so over time the cost of owning the app increased
since every problem was multiplied by the problems inherent in debugging something magical
yes, tons of DSLs and lifecycles
marks of the beaste
yeah that’s true
so i guess you hit a point where it made sense to move
which is OK too
yeah totally
it was organic
i like having a free heroku account that magically got me setup without knowing a thing about java
and now i’m looking to take it a little further
but the key thing i think is that we didn't move to some other magical thing
i bet i’ll get to a point where it makes sense for me to move again
instead we went a level deeper
yeah, that is fair
like my rails buddies
super into docker now
it's the new magical thing
but i won’t look back and be like “heroku sucked”, i’ll just be like “i outgrew that setup"
right, totally
altho
if you're at all interested in AWS you may be interested where we landed
micha identified like the 3 things we need to use from AWS to make awesome web and worker apps
but hold that thought
i have an appointment to get to
i’ll bbl 🙂
will do. gonna sleep soon but it was fun to chat!
cells from CL, in clj/s
hoplon shoutout in readme. has weird/cool ideas, like "awakening"
i was actually just about to ask if javelin could be used in clj
maybe i should look at this too
the ephemerality looks interesting
i was vaguely wondering how to get a subscription of changes coming from rethinkdb into the cell model, without explicitly resetting things to nil
after every change
if you want to know that you talked to rethink db just have it include a timestamp or transaction id
@micha yeah i’m working on a timestamp + sequence number for inserts and queries atm
something like
(-> (rq/db r/rethinkdb-db)
(rq/table r/rethinkdb-table)
(rq/order-by {:index (rq/desc "stamp-tx")})
(rq/group ["e" "a"])
(rq/limit 1)
(rq/run conn)))
i don’t yet know how to get changefeeds working
about to ask in the other chat room 🙂
ah, and now i can learn how channels work
https://github.com/apa512/clj-rethinkdb/blob/master/test/rethinkdb/core_test.clj#L228
the joys of being a noob >.<