Fork me on GitHub
#clojurescript
<
2015-07-25
>
mfikes00:07:26

@dnolen: Yeah, I assume they want the rights to it. (Nothing on their website, but I’m assuming that’s the case.)

mfikes00:07:33

@dnolen: Anyway, yeah. Awesome talk!

dnolen00:07:56

@mfikes: was fun to demo code I got working yesterday 😛

mfikes00:07:09

@dnolen: Very brave. Hah!

dnolen00:07:03

@mfikes: the first time I demoed ClojureScript at a conf was JSConf 2012

dnolen00:07:18

the story between then and now - can hardly be more dramatically different

mfikes00:07:52

Wow. Jelly stains. Thoughts on JavaScript, LISP &amp; Play https://youtu.be/AnzMEdC2FDk

dnolen00:07:57

@mfikes: I think that was just after cljsbuild appeared, good REPL story, source maps - non-existent

dnolen00:07:10

no proper incremental building, etc.

mfikes00:07:35

Watching it now. John McCarthy was still alive at the time. simple_smile

dnolen00:07:00

@mfikes: yeah Dan Ingalls (original Smalltalk team) was in the audience

dnolen00:07:02

that was frightening

mfikes00:07:08

Holy shite

ericnormand02:07:34

just bootstrapped cljs

ericnormand02:07:45

eval working in the browser!

ericnormand02:07:52

I never thought it would happen

ericnormand02:07:17

is it known to work with advanced optimization?

mfikes02:07:54

@ericnormand: David said bootstrapped would only work with :none and :simple

ericnormand02:07:13

I looked around in the docs, but couldn't find it

mfikes02:07:38

I think the :simple stuff was mentioned in here or IRC FWIW. Can’t recall whre.

ericnormand02:07:47

can I help out by recording it somewhere?

mfikes02:07:29

That’s a good question. I don’t even think the new cljs.js stuff or things about bootstrapped even have a page for stuff like this.

mfikes02:07:15

Perhaps it could just go as notes to the existing compiler options page (where :none et. al. are described.)

mfikes02:07:25

In truth, that page was created to answer the frequently asked question about whether bootstrapped ClojureScript means we can develop without Java.

ericnormand02:07:52

you say "the new cljs.js"

ericnormand02:07:57

where is that?

ericnormand02:07:07

or what is it?

mfikes02:07:27

That is the new namespace that contains the support for making use of bootstrapped ClojureScript.

ericnormand02:07:41

I'm trying to make an embeddable compiler widget for my blog

ericnormand02:07:46

and my courses

ericnormand02:07:53

but it's kind of big to put on the blog

mfikes02:07:54

Ahh… are you using cljs.js to do it?

mfikes02:07:47

That has eval-str, etc.

ericnormand02:07:02

I just took the browser/cljs_bootstrap/dev.cljs and modified it

ericnormand02:07:38

I did not see that

mfikes02:07:26

The overall goal is, if you want to use bootstrapped ClojureScript, you can simply make use of that cljs.js and call, maybe eval-str

ericnormand02:07:29

it can load libraries

mfikes02:07:47

Yes. If you want to get fancy. Planck is making use of that now.

mfikes02:07:55

Replete would also do so in the future.

ericnormand02:07:16

I can't see needing that just yet

ericnormand02:07:32

I really wanted a textbox that people could try to implement map in

mfikes02:07:51

Yeah, eval-str is all you’d need.

mfikes03:07:12

Planck is using it here, if you are looking for another example client https://github.com/mfikes/planck/blob/master/ClojureScript/planck/src/planck/core.cljs#L97

mfikes03:07:01

I think Joel Martin recently updated http://ClojureScript.net to use cljs.js

ericnormand03:07:40

is state to hold def's and things?

ericnormand03:07:14

the environment, that is

mfikes03:07:42

I’m not sure…. I think source map info is dropped in there. I haven’t looked in the state atom yet to see what’s really in there

ericnormand03:07:07

so you just need to create an empty one and keep using it?

ericnormand03:07:43

I just started the Jelly Stains video

ericnormand03:07:57

and I'm amazed by how small @dnolen's hair is

mfikes03:07:10

He had hair back then. Wait….

ericnormand03:07:48

well, it would be nice if advanced worked

ericnormand03:07:51

would be much smaller

ericnormand03:07:00

is there a reason cljs.js/compile would always return ""?

ericnormand03:07:41

or, rather, always return "" when compiling a literal value

mfikes03:07:51

Try telling it :context :expr

mfikes03:07:13

I wonder if that is available for cljs.js/compile or just eval-str

ericnormand03:07:58

what does context do?

mfikes03:07:37

It is telling it the context of what is being evaluated. Like expression, statement, return. AST concepts. So for a REPL you are giving it an expression to evaluate. Especially a literal like 1

ericnormand04:07:56

but now it's throwing an assertion error

ericnormand04:07:06

wrong number of arguments 😞

mfikes04:07:13

FWIW, David has only recently (a day or so ago) finished coding up that stuff and Joel Martin and I have been trying it, finding defects, logging JIRAs.

mfikes04:07:32

IOW there could still be defects to be found.

mfikes04:07:06

Some JIRAs have been logged, but not yet fixed, etc.

ericnormand04:07:25

it's amazing this works

ericnormand04:07:36

still some things I don't understand

ericnormand04:07:45

but they'll have to wait till morning

ericnormand04:07:49

thanks so much!

ericnormand04:07:51

this is awsome!

mhuebert13:07:27

I am having fun with eval as well. Fantastic work!

mhuebert13:07:27

does anyone know how to bring other namespaces into the compiler environment? (e.g. clojure.core)

mfikes15:07:25

@mhuebert: An ns form with a :require

mhuebert15:07:03

@mfikes what do you use for load-fn?

mhuebert15:07:30

I was looking at that… slurp, is that for in a browser or in node?

mfikes15:07:35

@mhuebert: Planck is still in the process of being updated for cljs.js

mhuebert15:07:09

@mfikes so for browser usage, the load-fn needs to find js or cljs source for whatever path is required

mfikes15:07:35

To make Planck be useful, my plan is to implement I/O facilities and other stuff as well as making it support this

Usage:  planck [init-opt*] [main-opt] [args]

  With no options or args, runs an interactive Read-Eval-Print Loop

  init options:
    -i, --init path     Load a file or resource
    -e, --eval string   Evaluate expressions in string; print non-nil values

  main options:
    -m, --main ns-name  Call the -main function from a namespace with args
    -r, --repl          Run a repl
    path                Run a script from a file or resource
    -                   Run a script from standard input
    -h, -?, --help      Print this help message and exit

  The init options may be repeated and mixed freely, but must appear before
  any main option.

  Paths may be absolute or relative in the filesystem

mfikes15:07:14

@mhuebert: For any JavaScript environment, in order to support requiring code, *load-fn* needs to be properly implemented. The requirements of that function are documented fairly well.

mhuebert15:07:47

@mfikes: yeah I’ve been going over those docs. I’m a bit confused about what kind of string to return for, say, clojure.core.

mfikes15:07:58

@mhuebert: Are you considering a case like (ns cljs.user (:require clojure.set)) ?

mhuebert15:07:04

@mfikes: as a basic example, (ns cljs.user (:require clojure.core :refer [shuffle]))

mhuebert15:07:36

i mean I’d like to refer all of clojure.core

mfikes15:07:17

@mhuebert: Is clojure.core something that can be compiled as ClojureScript?

mfikes15:07:39

@mhuebert: There is a cljs.core/shuffle

mhuebert15:07:36

@mfikes yeah, that would be it. I can type in (clojure.core/shuffle [1 2 3 4]) and that works too but maybe its mapped to cljs.core/shuffle

mfikes15:07:02

@mhuebert: Interesting. I’ve never gone down that path. simple_smile There is this: http://dev.clojure.org/jira/browse/CLJS-1362

mfikes15:07:36

@mhuebert: In other words you should be able to do (shuffle [1 2 3 4])

mhuebert15:07:47

if I eval-str (fn[{:keys [a b]}] nil ) I get warnings - WARNING: Use of undeclared Var cljs.core/not for not, apply, hash-map, get

mfikes15:07:40

@mhuebert: Maybe that is the same root cause as CLJS-1362

mhuebert15:07:50

@mfikes: ah that would be it simple_smile

juhoteperi16:07:55

@dnolen: How safe is cljs.analyzer for tooling to use? Boot-cljs currently uses *cljs-warning-handlers*, *cljs-warnings* and with-warning-handlers.

juhoteperi16:07:49

They are used to check if any warnings happened during the build.

bensu16:07:28

@juhoteperi we recently discussed this in #C07UQ678E , cljs.analyzer changes often and tooling should use cljs.analyzer.api instead.

bensu16:07:54

@juhoteperi: (that is in general, boot-cljs might have special needs)

juhoteperi16:07:57

Yeah using api namespaces would be preferred, but it doesn't currently provide anything for this use case.

lazy-lambda17:07:09

Has anyone experienced [object Object] is not iSeqable error ?

lazy-lambda17:07:43

i was trying to do this (for [i vector-of-list] [:custom-reagent-component i])

dnolen17:07:03

@juhoteperi: it’s not safe to use at all. if you use it you should expect your library to break all the time.

dnolen17:07:28

@juhoteperi: if there’s something people need start opening enhancement tickets + patches.

dnolen17:07:38

to the api namespaces

dnolen17:07:42

there’s already work underway to present better names and to hide the dynamic vars.

dnolen17:07:00

this approach should be replicated where possible.

dnolen17:07:41

now users don’t have to know about the cljs.env namespace, or have a confusing name that clashes with analysis environments, etc.

lazy-lambda19:07:03

Are there any spread-sheet library in Cljs like http://handsontable.com ?

bensu19:07:40

@lazy-lambda: It probably means that vector-of-list is not a sequence, since for requires a sequence and (seq? []) => false

lazy-lambda19:07:13

@bensu: the vector-of-list thing was actually an atom and I forgot to deref it. Silly Me. I should have updated here though. Thanks.

chancerussell20:07:38

Does anyone know of a way to pass figwheel a port number at runtime?

chancerussell20:07:52

Or, barring that, to assert a leiningen option at runtime?

shofetim20:07:28

@chancerussell I think that is configurable: https://github.com/bhauman/lein-figwheel#figwheel-server-side-configuration but maybe I didn't understand your question?

chancerussell20:07:55

Yeah, I’m just looking for a way to set it at launch, rather than by modifying project.clj

shofetim20:07:31

I think it may look to the env variable PORT

shofetim20:07:41

I've not used figwheel directly; I've always used chestnut. There are two ports one for the HTTP server and one for websockets. If you are using the Chestnut template you can control the HTTP port via the PORT env variable.

chancerussell20:07:42

Hmm, tried but no luck. May have to just use sed the project.clj

chancerussell20:07:56

Cool, I’ll check on how Chestnut does it.