Fork me on GitHub
#beginners
<
2016-09-02
>
eslachance01:09:30

Well edge kinda failed. Trying hoplon 😒

eslachance01:09:11

Welp, edge didn't boot the first time and the second time I got 404 on all resources. And Hoplon didn't even show anything on the page. I guess I'll work to try to understand Luminus.. since it does seem to at least start.

shaun-mahood01:09:54

@eslachance: Both edge and hoplon are primarily boot based, so that could be the issue. Of the two, I think hoplon is quite a bit more mature (and boot came out of that project) so I bet the #hoplon channel could help you get going. If you stick with Luminus, https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition is a great resource and is written by the Luminus author. Have you got anything specific you want to build first? There might be an easier or more tailored option to at least get you started.

akiva03:09:02

Here’s another vote for Luminus. I’ve recently switched a project over to it and it’s been charming so far.

josh_tackett03:09:10

Looking for XML to JSON anyone know a good library?

seancorfield03:09:57

@josh_tackett XML -> Clojure data structures (clojure.data.xml) -> JSON (clojure.data.json or Cheshire)

josh_tackett03:09:45

@seancorfield is there a conversion function?

josh_tackett03:09:54

I need to go from XML to JSON

josh_tackett03:09:06

like a (defn xml->json …)

seancorfield04:09:37

I’m not even sure that would make sense directly since you have attributes and bodies in XML but only really a data structure in JSON.

seancorfield04:09:11

That’s why I suggested going XML -> Clojure data structures (where you can transform the raw "XML representation" however you need) and then Clojure data structures -> JSON.

seancorfield04:09:16

There are multiple ways to represent XML as data (or JSON) anyway.

eslachance05:09:34

@shaun-mahood: actually the plan is a web application, eventually I want to integrate React and Om. The reason I want to learn Clojure is ultimately that I'm going for performance, and the idea of atoms, webhooks and the performance I've seen in clojure apps seem superior to, say, Node especially in terms of updating the Dom. In terms of development, the REPL and figwheel are just impossible to ignore as some of the greatest tools I've ever seen. If the latter were readily available in node I might just stay there but my attempts at finding such tools lead me to very complex projects that were small and mostly based on Linux and Vim.

eslachance05:09:43

Speaking of Linux, since I'm developing on Windows (yes yes I know, eww, but I'm also a gamer), this might be part of the reason why I'm having issues with both Hoblon and Edge. Lein seems to be a little more robust on Windows for the time being.

sveri08:09:15

@eslachance +1 for lein on windows (7 / 8) in my case. I did not get boot working there the last times I tried

sveri08:09:49

@eslachance If you want to start very simple have a look here: http://www.http-kit.org/server.html. Start a new leiningen project, add http kit and a few lines of code, have a server running.

dominicm10:09:14

@eslachance edge contributor here. Please come bother us in #yada until we fix your edge issue!

dominicm10:09:26

Edge isn't well tested on Windows, as I'm pretty sure all the users are *nix.

dominicm10:09:43

As of boot 2.6.0 windows 10 should be fully supported as I understand.

eslachance15:09:56

picard-facepalm Edge and Hoblon don't work out of the box, Luminus crashes after the readme, and even reagent-template just gives me an error stack the size of Atlanta. I know what I'll do - I'll follow my own advice to "noobs in node.js that want to play audio with node-opus and ffmpeg"... "USE LINUX". Will come back with a full functional ubuntu VM later tonight.

shaun-mahood15:09:53

@eslachance: I've been developing happily on Windows, both Clojure and CLJS, for the past year or so. Using re-frame on the client side, ring on the server side. Happy to help with any issues, but from what I've seen your setup and goal are pretty similar to mine so I doubt you actually need to setup a Linux VM to be productive.

eslachance15:09:36

I know it's doable but also you need a bit more troubleshooting, something I'm not yet proficient at

dpsutton15:09:35

what do you mean it crashed after the readme?

eslachance15:09:41

@dpsutton : I mean following the readme to the letter, when I refreshed the page I got an error (see #C077KDE3A )

shaun-mahood15:09:58

@eslachance: I think most of the troubleshooting is in the phase you're in now - once the basics are there things work really well in Windows now. If you're more comfortable in Linux that's a different matter, but I'm just terrible at Linux... so Windows it is 🙂

dpsutton15:09:41

ah. you defined save-message! after you used it

dpsutton15:09:47

move it to before the function call

eslachance15:09:22

Will have to try tonight, I have a youtube livestream to prepare for work 😛

shaun-mahood15:09:07

@eslachance: I'd like to improve the re-frame getting started experience, so if you want to try it out later on feel free to DM me or post on the #re-frame channel with any questions or areas that are difficult to understand - it's really valuable to get the insight from a new user.

eslachance16:09:10

Hmm... well let's put it this way: I'm a person that learns by example and by handholding the first steps. aka, I need a fully-functional very basic project that I can study.

eslachance16:09:38

The expectations I had for something like Edge are almost there, I just need to figure out that 404 issue I guess.

eslachance16:09:16

inb4 I try at work and it works straight away

shaun-mahood16:09:28

@eslachance: Sounds like a reasonable way to learn to me. Hopefully you can get Edge working, it looks like a cool project and I've been meaning to try it.

eslachance16:09:47

Yep! Works now, fix found thanks to dominicm in #yada and I've reported the issue on the edge repo. \o/

dominicm16:09:31

@shaun-mahood It is a cool project. No bias. 😉

shaun-mahood16:09:41

@dominicm: You know, the only thing keeping me from it is my love of figwheel.

dominicm16:09:59

@shaun-mahood We have boot-cljs-repl, it's almost as good, promise 🙂. I'd be interested to know if you feel any features from figwheel are missing actually, as I couldn't see anything beyond code highlighting in single-error states.

shaun-mahood16:09:37

@dominicm: Have you tried figwheel recently since the error messages have been added? I think 0.5.4 and later, it's at 0.5.6 now. It's pretty cool!

dominicm16:09:36

@shaun-mahood: I contributed to Figwheel recently, so I believe so, yeah. But I didn't mess with them extensively. I kind of hold the position that they're cool, but not that useful, as I tend to debug in my editor (jumping by the line number), not by the code shown by figwheel. This is what I think I was trying to describe by "code highlighting in single-error states" but I might be way off.

shaun-mahood16:09:55

Might be, I find it catches most of my idiotic mistakes (which is an unfortunately high percentage of them).

dominicm16:09:23

@shaun-mahood but they're caught and display by boot-reload/boot-cljs-repl 🙂 just not as clearly. I tend to just checkout the line number in my cljs. Again, maybe the messages are really good in some cases.

shaun-mahood16:09:07

@dominicm: Oh cool, I'll have to try it out at some point. For some reason I had the impression that it just did hot-reloading and nothing else, but that's probably left over from the initial boot announcement.

dominicm17:09:24

@shaun-mahood Oh no! You get the exception and line number(s). Just no inline of the code. It's sorta a 90% thing, and I believe it should be easy to extend.

chris17:09:30

I didn’t even realize it did hot-reloading, somebody might want to stick that on the readme for boot-cljs-repl

sveri18:09:03

@eslachance I have been using Windows exclusively for more than two years. Luminus also worked for me. If it does not, it surely is not windows fault. The only thing that did not work, was boot. There have been some minor issues with template reloading or similar stuff, which I all got sorted out. So if you move to linux, this will not solve your problems, except you want to use boot.

dominicm20:09:09

@chris: needs combining with boot reload

eslachance20:09:04

@sveri yes I see that above someone indicated what was wrong - will need to check at home tonight

dpsutton20:09:27

i'm about to start my first reagent/reframe project and I'm not sure how to connect to a cljs repl. i created the project with lein new reagent projectname +cider. What do i need to run to connect to a repl from cider?

shaun-mahood20:09:35

@dpsutton: There's also https://github.com/Day8/re-frame-template which also has the +cider if that makes it easier. Have you ever connected cider to a cljs repl before?

dpsutton20:09:54

no this is my first time cljs

dpsutton20:09:32

and i'm getting a cider error. Its not getting any version info back when connceting. Hmm

dpsutton20:09:38

Let me try the reframe template

shaun-mahood21:09:20

Have you worked with cider for Clojure projects before? This might work to at least figure out where the issues is https://markhudnall.com/2016/04/25/starting-figwheel-in-emacs/

dpsutton21:09:21

i've worked with cider and have a few pull requests on it. I'm just new to the other side of it

dpsutton21:09:48

it was just in the asking the repl middleware what version everything was to make sure everything was ok

dpsutton21:09:51

that came back nil

dpsutton21:09:14

i was stepping through it but i've gone to the re-frame template (as that was what i wanted to use) and i've gotten the clj repl up and running

dpsutton21:09:46

and actually that template specifies the version of nrepl from melpa-stable rather than the current 14.0-snapshot

shaun-mahood21:09:46

Oh good, glad it's working. Feel free to ask all your beginner re-frame questions on the #re-frame channel, we've been working on updating the docs to the new version and I would be really interested to know what parts give you trouble as you get into it so we can fix them for other new users.

dpsutton21:09:19

ah cool. i'm heading there now