This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-01
Channels
- # aws (7)
- # bangalore-clj (10)
- # beginners (27)
- # braveandtrue (4)
- # calva (2)
- # cider (9)
- # cljs-dev (20)
- # clojure (228)
- # clojure-germany (5)
- # clojure-spec (7)
- # clojurescript (32)
- # datomic (11)
- # figwheel-main (10)
- # fulcro (21)
- # hyperfiddle (3)
- # off-topic (53)
- # onyx (1)
- # portkey (2)
- # re-frame (21)
- # reagent (1)
- # shadow-cljs (5)
- # spacemacs (7)
- # specter (4)
@vheuken I proposed it as an addition to Monger https://github.com/michaelklishin/monger/pull/176
How do you guys typically manage globals? I'm about to refactor/clean up my code barf for https://github.com/ahungry/ahubu and break it down into sensible modules (its a webkit based browser with vim/emacs like bindings and will have a lot of hooks ala emacs hook system soon). But I rely on a few global atoms such as the javafx stage + current scene (tab/buffer etc.)
yea i'm not real sure why I put off looking into clojure for so long, but in the last 2 weeks, definitely bitten by the clojure bug 😆
I know lots of slack integrations are written in node, so i'm sure you could use clojurescript if for some reason plain old clojure can't (its just api calls though )
I just saw this article pop up, slack has a poor policy on any add on that leaves what they're comfortable with https://g3rv4.com/2018/08/betterslack
whats the best option for profiling clojure?
You may want to watch this: https://youtu.be/HNp5EaRs3KI
I, ll do thar. Thanks
Something simple, If someone have used Haskell I'm searching something like "-prof"
@lucaspolymeris i like to use oracle jdk together with jmc
myself, but YMMV
You may want to watch this: https://youtu.be/HNp5EaRs3KI
@dl maybe you can send a picture as a message, and use that to show an SVG of the generated kanban?
@clojurians-slack interesting... but I would be interested in moving them too
maybe first design an interface in clojure, so that you can create new products and see the traffic stats there
anyway currently every legal entity that uses the script got their own DB and php instance with different domains
when migrating the code base over to clojure, should I keep it that way and maybe migrate each mysql db into their own datomic or should I create a big clojure app that keeps all of the code in one instance?
I see this article here: https://medium.com/@kari.marttila/become-a-full-stack-developer-with-clojure-and-clojurescript-c58c93479294
maybe I should keep the backend in php for now and implement a frontedn that accesses the mysql db in cljs?
If you have scaling issues with php I'm not sure how "inject clojure into php" will help. Not sure what that would even look like. I would imagine you want to move responsibilities to Clojure piece by piece.
@dl yeah, there's a lot of options. You can do a gradual migration or a clean slate, green field thing. Or variations in between. I don't have a lot of php experience
@the2bears hmm I think I miscommunicated scaling issues... the code is fast enough for now
maybe a better word would be its a little buggy and takes longer time than necessary to deploy a new domain
sorry for the newbie questions, I am currently working trough Getting Clojure by Russ Olsen
Well, you've given a pretty high-level and very vague description of your system w/some jargon specific to you. I would be hesitant to suggest anything without knowing what the architecture looks like now.
It you ask whether you should use CLJS for the front-end, what is it even replacing? (for example)
But your approach makes sense in that front/back is usually a clear separation and lends itself nicely to a piece-by-piece approach to replacing and refactoring code.
For the front end, either a thin thing generated as hiccup, sent out server side, or if you need a lot of dynamism, CLJS on the front end
So back end talks to the dB, or should in most cases, as you don't want to expose it to the browser.
There's lots of ways to skin the cat. A good bridge from the php/rails world is the luminus template and tutorials
It's unclear from a slack conversation what you have and don't have. It's getting really off topic.
create a CLJS frontend that connects to the CLJ backend and displays the data in the browser
Yes, that's a good description. I don't do much web stuff, but look at the examples in the web frameworks for a starting point. Luminus was mentioned above.
np! I'd recommend reviewing these strategies http://www.luminusweb.net/ and once you have a migration path worked out, then explore datomic ions and see if you can move your data model over
What do you mean? They will be separate processes. So I assume we're talking REST apis to get things going quickly.
@the2bears yeah I mean how does backend and frontend code communicate... in PHP its kind of all together and accesses the DB directly (what a mess!)
for example... customer goes on a page and enters credit card data, the page is just an html file which accesses the PHP API for sales then in the Backend, but its all kind of in similar folders
Just what I said, get a simple REST example working. Write a CLJ handler that reads something from your dB. That's a web-based API you'll create. Then, call that from CLJS in your browser and display the result.
thank you so much guys! I will study some more getting clojure and then do my first steps in the project
but its probably not possible to run the clj backend in the same project with the PHP code...
so I will have to deploy the clj backend code on the same server to be able to access the DBs
I mean the php frontend file which displays the order form is actually directly using the DB and PHP session as the API script which runs in the backend
The "front end file"? That is a back end file that generates the html that the browser displays if I understand. Not sure I do, as we're talking circles here wrt definitions. Front end is the browser in your case. Not the file running on the server that generates the html returned to the browser.
JDBC I believe grabs a handle to your locally running db. If you have access to the local box and can install java and clojure, etc, you should be good
You sound pretty unhappy with the whole setup. Maybe look into a more datomic ions solution sooner rather than later.
Yeah, you should figure out the architecture you want first, before you spend time changing anything in the current setup.
And it sounds like you're not happy with the security around the db. Might want to square that away sooner rather than later, or migrate to a cleaner setup.
so first step is getting my feet wet in CLJ and CLJS by creating an interface for the existing DB model
It's the core of your business, definitely not due to security and SLA of the interface.
So Mike Fikes has been doing all these performance tests on the clojurescript compiler using a large corpus of problems from the 4clojure website. A quarter million lines of clojure code. Pretty cool stuff. But it got me thinking, what if you put all that code into a word2vec? Would you be able to query for semantically similar code?
So I whipped this up this morning: clojure -Sdeps '{:deps {johnmn3/coal-mine2vec {:git/url "
"map" is to "reduce" as "for" is probably to "loop"
... but may also be one of these: "&" "c]" "a]" "["
Right? There's probably some interesting applications. Maybe some code gen thing, for testing.
I think one of the hardest things about clojure’s core library is that it’s so vast, and relatively unorganized
you might have a task that you think might already be solved (or would be surprised to find out!), but not know how to search for what you want
so being able to draw relationships between fns and forms that are used on similar data structures or similar uses could be really valuable, actually!
Another good inference:
"inc" is to "dec" as "max" is probably to "min"
... but may also be one of these: "loop" "a]" "[b" ":else"
Also, you could take spec.gen and produce billions of valid functions, and then train the word2vec on that, to see if it can heuristically detect invalid forms
Hi All, had a small question. How do I set the order of execution of my unit tests? How do I make tests from one namespace run before tests from some other namespace?
but you can check out https://clojuredocs.org/clojure.test/run-tests to specify an order of namespaces
@punit-naik I'll second @dpsutton’s comment: you really should not have test order dependencies -- each test should be self-contained and should be able to run before or after any other test. Otherwise your tests are not repeatable on their own.
and the docstring to the test namespace is really great: https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj
@seancorfield @dpsutton Thanks for your suggestions!
How do I use spec to match exactly a keyword? E.g If I have [ [:foo "a"] [:bar "b"]] but I need to apply different specs to "a" and "b"
If you have (def m {:foo "a" :bar "b"})
, then you could do:
(s/def ::foo string?)
(s/def ::bar string?)
(s/def ::map-spec (s/keys :req-un [::foo ::bar]))
Does that answer your question?@punit-naik If you really want a sequence like set up, run some tests, teardown, best to do that inside one deftest form.
@foobar use #{:foo}
to match