This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-03
Channels
- # beginners (446)
- # boot (16)
- # cljs-dev (2)
- # cljsrn (30)
- # clojars (2)
- # clojure (143)
- # clojure-finland (1)
- # clojure-greece (1)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (20)
- # clojure-uk (7)
- # clojurescript (167)
- # code-reviews (1)
- # community-development (12)
- # core-async (27)
- # cursive (3)
- # data-science (9)
- # datascript (2)
- # emacs (1)
- # graphql (46)
- # immutant (5)
- # jobs (2)
- # leiningen (1)
- # luminus (1)
- # lumo (76)
- # off-topic (79)
- # perun (2)
- # protorepl (33)
- # re-frame (21)
- # reagent (62)
- # ring-swagger (1)
- # rum (18)
- # spacemacs (6)
- # specter (4)
- # test-check (4)
- # unrepl (9)
- # untangled (2)
- # vim (4)
- # yada (1)
bit stumped. Why does (js/history.pushState nil nil "pizza") worked, but ((.-pushState js/history) nil nil "pizza")) throw error?
@mobileink I haven't tried, but look at this: https://github.com/anmonteiro/lumo/issues/171#issuecomment-305617325
Oh oops, I have just now read the whole conversation, ignore the above 😁
@alexwheeler is js/history.pushState
a method call or a property access?
@joelsanchez Why not just use https://www.rust-lang.org/en-US/ ?
the library tells to use like this $('selector').packery()
and I used like this (.packery ($ ".grid"))
if anything it would be js/$
javascript globals are not implicitly in clojure scope
Chrome might be aliasing js/$
to js/document.querySelector
... I would explicitly check for js/jQuery
the problem is when I call (.packery ($ ".grid"))
tells that .packer
is not a function
What's the simplest way to do some generative testing of my CLJS tests in my bitbucket pipeline? I have it setup to do an uberjar build looking for compile problems at the moment. Obviously lein test works (for clj tests) but for CLJS I need to have a JS VM.
That is to say I have CLJS specs defined. I'm looking for a non-fiddly way of running stest/check from my docker script.
Perhaps this is the answer: use node. (I'd appreciate any other recommendations) https://github.com/clojure/clojurescript/wiki/Quick-Start#running-clojurescript-on-nodejs
@olivergeorge I haven't tried this, but I've seen it mentioned https://github.com/bensu/doo
some of the environments it supports are built into the vm (or are deps you can pull into the jvm)
thanks @noisesmith i'll keep that one in mind.
Quick followup. Node works if you're sure your code isn't looking for js/window or the like. That's problematic where logic which sits alongside rendering code.
My first bump was that the ns referred to a foreign lib which assumed window existed.
seems like a bug in the library?
I use lein-doo successfully to run cljs tests, recommend it
@noisesmith @joelsanchez ferret code is embedded in the emacs org-mode file - http://ferret.org
Browsing through the code right now, let's see if I can achieve "hello world"
@deas Sounds interesting. Seems like j2v8 would allow Clojure (JVM) to manipulate node/V8 instances. Specifically, though, you wouldn't be using it from ClojureScript but from Clojure. And a lot of the reason some folks want CLJS on node is get rid of their JVM lol
@john Not quite sure yet. I think those targeting the browser should embrace webpack. They say j2v8 supports node modules. And js land can call into jvm as well. Might help wrt potential cljs webpack loader, figwheel, gcl and other goodies which are jvm today.
The Nashorn based approach (Avatar) to get node modules executing in the jvm was immature and pretty much dead last time I checked.
@olivergeorge uncharted waters but chrome tream recently released a headless version. Guess you could use that with bensu/doo
Kanaka is one prolific wizard though. Maybe Ferret would be a good way to learn some C++
@john Running a wm with Ferret, although the code is 99% C++ and 1% Clojure, but I will improve it now
So happy to see it can be done
window manager
as you can see it totally sucks, it is basically tinywm inside a string http://incise.org/tinywm.html
but hey...
Nice, so you should be able to decompose some of that into smaller functions and then make a more composable wm system.
Indeed, indeed
Build script: https://gist.github.com/JoelSanchez/9656c7096ebf9e356beef45506be4017
You can download the ferret standalone executable and execute that script to build it
Use xnest to test the wm: " Xnest -ac :2 & "
you move windows with shift pressed, that's it
great functionality
if I have a multmethod foo
and a macro bar
, what will (methods foo)
be during bar
's macroexpansion? In clojure, it picks up all my registered methods, in cljs it skips some
Afaik in cljs you need to explicitly require any namespaces that extend a multimethod, as opposed to clj
Not sure if that's your case
In clj the multimethods get extended by namespaces no namespace is :requiring (but the namespace has to be loaded, of course)
In cljs the require is needed (this is my experience)
wait how is the ns ever loaded if nobody requires it?
(clojure.tools.namespace.repl/refresh-all)
I think leiningen is able to load all the namespaces of your application on startup as well
Could never do that with cljs
I've never had lein load namespaces not in the tree of things required by my init-ns or main
and if it did, it would just be disguising errors that would happen when I deploy
Indeed I'm probably mistaken, and refresh-all is the way this gets done
Found the source of my confusion: https://stackoverflow.com/questions/39585510/using-clojure-multimethods-defined-across-multiple-namespaces This answer is incorrect as noted in the comments that I did not read
Solution works only on the repl and with refresh-all
feel like we could replace namespaces with datomicy thing where you query for all the vars you want and close over them for an ephemeral scope
Immutable namespaces have been discussed repeatedly over the years. Some people have even tried implementing them.
I think you can't change what something refers to in Haskell
@joelsanchez yea but that namespace situation is weird
it gives you relational plus inheritance (recursive queries) with granular timetravel by its nature and by design
Indeed the pull api is amazing, but i'm having a hard time imagining that as the source of namespaces
I think in some old talk - or email - even RH speculated on the same idea... storing vars in datoms, or something like that.
namespaces are an affordance to bootstrap the next phase of shared data/code which would be something that affords what eavt affords, however implemented
things like versioning and dependencies (some stuff hit at in Spec-ulation RH talk) could be nicer over it
Not long ago someone posted on HN a programming language whose development environment worked by editing the AST visually, no text involved (not really related to the namespace conversation but)
you can render asts from pulls automatically as draggable nested blocks on an ipad or whatever
Damn, found it! http://www.lamdu.org/
"The main idea behind the Lamdu project is that the canonical representation of programs should not be text, but rich data structures: Abstract syntax trees."
Here's one from 1986 https://youtu.be/I9LZ6TnSP40
yeah thats nice @joelsanchez
IMO language is abt empathy and computer languages empower humans by having them empathize with a different kind of processor through their intuitions of scope and naming
I think one way to think about it is that visual editing for one kind of dsl is ast editing
If an element in it is a color you render a colorpicker, or a vector you render a direction picker or absolute position picker depending on metadata, etc
I think all of this kind of relates to http://witheve.com/
There's that. But even without inline objects, I think parinfer/paredit/other structural coding tools are just approaching the true "ast editor"
Lisp is pretty close to an ast, so lisp editing tools are a kind of "ast editor", kind of...
Anyway a more visual and interactive way to do it would be nice
eve feels a less general version of query -> transact over eavt but i think that may be too reductionist
made a game in 48 hrs on that for Ludum Dare and it went ok -- cljs gets u 70-80% of the way there out of the box
the c lua engine i had to make the ui and gfx layer from scratch but react native gives you super solid ui really easy
lol and I don't work in a dev shop, so I almost never meet people IRL that know what anyone here would be talking about.
tbh even in dev shops you have to try consciously if you wanna engage along this dimension
@joelsanchez in that last vid u c me editing stuff visually in the game live 😮
I work as a developer, just got a new job as a cljs developer, but I've always been working at PHP shops, no talk about ast editors, lisp, functional programming, or anything there
So yeah...
Watching the video
How's the game implemented exactly? Where does it run? Browser?
That editor looks lots of fun
How do C, Lua and cljs interact? Or is it only C and Lua?
I'm terribly confused 😛