This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-25
Channels
- # beginners (21)
- # boot (37)
- # cljsjs (1)
- # cljsrn (1)
- # clojure (48)
- # clojure-greece (3)
- # clojure-poland (1)
- # clojure-quebec (4)
- # clojure-spec (40)
- # clojure-uk (1)
- # clojurescript (113)
- # cursive (13)
- # events (3)
- # hoplon (183)
- # jobs (5)
- # off-topic (2)
- # onyx (49)
- # planck (35)
- # re-frame (8)
- # reagent (2)
- # sim-testing (1)
- # specter (4)
- # spirituality-ethics (2)
- # untangled (1)
- # vim (2)
- # yada (1)
hi guys
how can i create slack interface using clojurescript?, is there a library which will help in this?
@dnolen: should clojure.spec.gen
alias to cljs.spec.impl.gen
?
and if we preferred cljs.*
usage, should we alias cljs.string
=> clojure.string
, etc
@shaunlebron: yes to the former. We’re not doing any more aliasing.
yesterday changes were about eliminating differences between Clojure & ClojureScript not aliasing specifically
i’ll think about whether to list such namespaces in the api docs as clojure.*
whenever possible
i’ll check the differences in their api and see if that’s a good idea
i imagine the original intention of using cljs.foo
convention was that there would be api differences with the ported clojure.foo
ns
ah I see
@shaunlebron: most of the api differences between (clojure|cljs).(test|pprint|spec)
are whether something is a macro or not
test
and spec
in particular rely on runtime metaprogramming stuff that we can’t do in ClojureScript so some thing which would otherwise be functions are macros instead
interesting
now that you implemented implicit referring, would you consider the clojure.*
to be the recommended interface, and the cljs.*
namespace to be an implementation detail?
oh actually, the (clojure|cljs)
namespace naming differences in clojurescript are a separate issue from implementation differences with the clojure libs
okay, there is a clojure.string, and a clojure.string
but a clojure.test and a cljs.test
the naming choice for took a turn to start using cljs.*
@shaunlebron: it’s important to understand what I said earlier
ClojureScript clojure.string
doesn’t require macros so there’s no conflict with Clojure clojure/string.clj
to be fair - in my experience is that hardly anyone understands this except for people who spent time contributing to the compiler
well, this is still confusing
src/main/cljs/
and src/main/clojure
former being the library and the latter being the compiler
because there’s no way for the compiler to not accidentally load Clojure clojure/spec.clj
because in jvm clojurescript, that accident could happen
the compiler has no idea what’s in a macros file and whether it’s for ClojureScript or not
i thought they were separated for some reason
i see
as I said hardly anyone who hasn’t contributed to the compiler understands this subtlety
so implicit referring and ns aliasing allows cljs files to pretend that this naming issue isn’t there
(well except for the :refer
bit which accomplishes something reader conditionals can’t do)
which is auto-referring without regard to its type
thanks for walking through subtleties
@shaunlebron: the auto-referring thing is pretty simple
we simply filter all the refers we couldn’t find in the runtime ns - and we try to see if macros exist for those
I think thheller actually had something like this working for shadow-build, so he gets credit for the original idea and ticket
I've been wondering for a while about the ultimate source of the cljs macro limitation ---is it just because the compiler is on the jvm? I recall an old @mfikes blog post where he demonstrated how to do bootstrapped macros in the iOS repl just by diddling with the namespace...
(There needs to be a "slowly understanding nod" slack reaction for when @dnolen offers yet another patient explanation of how this all works )
whew, here’s a doosey. When generating an externs file for a js lib… if that lib uses es6 import
syntax, including things like import * from ‘./…’
, how am I supposed to figure out what to “protect” from inside the externs file? Similarly, that es6 syntax has to be packaged by something … so assuming we bundle with webpack, what’s the deal with the exports there? It looks like webpack actually just ‘exports’ a function that is self-invoked with the dependency map...
I’m assuming someone has done this before, given the scope of cljsjs (but I cannot find an example of webpack inside cljsjs packages)
commit 515900f9762102987bda7d53b919dafc0b6c0580
Author: Rich Hickey <[email protected]>
Date: Thu Jun 2 19:45:57 2011 -0400
initial commit
announcement date is probably a better birthday
@shaunlebron: heh, yeah
@lwhorton: do JS libs publish es6 source?
anyway, es6 spec enforces statically analyzable exports/imports, so generating something like an externs file seems possible
@shaunlebron: this lib does… ill look around for an analyzer
i mean, you only have to protect the public API, yeah?
yes, but even with that i’m not too sure how es6 ‘exposes’ imports such as ‘import *’… for example, `export defaults { button1 as foo, button2 as bar }`. if I `require * from ‘button’` - what do i get?
import * as name from "module-name”;
you get a static export map from module-name
i don’t think you can just do import *
is what I’m saying
would the extern for that look like: var button = { foo: function() {}, bar: function() }
?
i don’t really know
i think an answer would only be meaningful in the context of the transpiled artifact
exploring the library’s transpiled source or interactively from a js console would give you the vars and paths to include in your externs, yeah?
i wouldn’t get caught up in the es6 stuff, especially when in reality it’s es5 es3 that our cljs applications are interoping with
Issues suggest this is not maintained: https://github.com/andrewmcveigh/cljs-time
Speaking of Google Clojure, thank dnolen for http://go.cognitect.com/core_async_webinar_recording
It's only been a couple days playing for me, but I was able to create a simple audio recorder
Hello, I'm planning on giving an introductory talk to my coworkers about Clojure(Script), to get them interested into this world. We're a web dev company so I'm mostly aiming to give them a taste of ClojureScript, but since they have little to none experience with LISP or functional programming, I need to cover the basics. Any suggestions on resources I could use? Existing talks, articles, exercises or examples? Thanks.
volrath: the interactive tutorial linked from here has been well-received: http://chimeces.com/cljs-browser-repl/
Anyone ever gotten Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher;, compiling:(/private/var/folders/kl/mtjj27rn63scmln5_xzbtc600000gn/T/form-init2613897690507300801.clj:1:125)
before?
Happens with advanced compilation, even when I comment out everything in my “main” namespace.
lein deps :tree
is clean. I wonder if one of the jars for the server side of the app is interfering? (This is a mixed server + client project.)
Interesting. If I explicitly set the closure-compiler jar just under the clojure dep itself, it works.
volrath: Stuart Halloway is good at quick up-to-speed for reading clojure code https://www.youtube.com/watch?v=VrmfuuHW_6w&t=13m05s