Fork me on GitHub
Bobbi Towers04:02:43

I'm attempting to create a knowledge graph of all the concepts necessary for Clojure fluency, for a new interactive learning platform. Does anyone know of any prior art in this space?

Alex Miller (Clojure team)06:02:26

Chas Emerick used to have a Clojure Atlas that was like that

👍 20

@porkostomus I guess you know of the technology radar of Thoughtworks (not clojure related, but might be useful) and as for a platform to make the knowledge graph browseable I would recommend it makes it easy to link concepts together. And it literally generates a graph. Also clojure toolbox would be related


Hi! I’d like to make a static site with deps.edn (or possibly lein) and while I could assemble the pieces myself I wonder if anyone has an example? Some things I’d like are: • Hiccup • Asset optimization (renaming of css files for cache busting, minification of css etc) • Live reload support


Never tried it, but Bootleg seems to be doing (at least part) of what you want


Interesting! Was more looking at deps edn aliases though that just run normal clojure namespaces


I find you find something with live reload and asset pipeline features, I would be curious to learn about this


For sure, I’ve had a setup in boot before that did many of these things and could probably just steal the code from the boot plugins. But would love to see some other examples of state of the art.


if you want to have static web page generator probably hugo in go is the best option. I know this is not Clojure, but right tool for the right job.

kwladyka11:02:53 - here is an example of my blog in hugo. I was trying crynogen before but IMO hugo win this game


even when it is far away from being perfect


I set up and use hugo at work, it is nice if you want to write some markdown and get a website out of the other end


> it is nice if you want to write some markdown and get a website out of the other end this is what bootleg (written in Clojure, available as native binary) also can do. how does hugo compare to bootleg?

Yehonathan Sharvit11:02:43

Take a look at this this clojurescript react wrapper:

Yehonathan Sharvit11:02:52

It’s a different paradigm that reagent


@viebel Is that related to static HTML generation or are you reacting to something else?

Yehonathan Sharvit12:02:48

I posted in the wrong slack group. My bad!


hard to compare hugo vs bootleg, because I didn’t use bootleg. hugo solve almost everything for you, but coding template is a nightmare. Debugging and documentation are pretty bad IMO, but many people think documentation is good. So expect debugging part and doc when coding template hugo is very good.


Hugo is a lot more "Rails"-like in that it's very conventions-based. There are pros and cons to this, but it does seem to mean themes work out of the box. You get a set of environmental vars based on TOML config files that can be accessed in your markdown. You have a top level dir with well-known folders and config TOML files: themes, static content, "content" (markdown files in a specific layout) and so on that you run hugo.exe on. If you want to do more than use/minorly edit an off-the-shelf template there's a lot(!) to learn. A divisive feature that sums up the hugo philosophy for me is auto-generating the nav bar for your website by using the dir hierarchy in the content directory. "Easy", not "simple" 🙂


I would like to hear more about bootleg and maybe see template / posts


Oh yeah, it compiles quickly. Some site generators are super slow.


so the downside of hugo is when I code template I feel I use brute force method to guess how it should be written, because errors messages and documentation don’t help. But expect of this, so writing posts, attach images, link structures etc. works pretty good

Bobbi Towers12:02:44

The author of bootleg wrote this recently: (oops, was already posted above ^^^)


Thanks for the input! I have tried hugo before and it was great for a blog site but I’m making a simple landing page. And I also just think that hiccup is the best thing out there… Oz is also very nice but again more targeted towards blogs etc.


why not raw HTML?


Does bootleg has sitemap.xml generator and all stuff around?


at least I don’t see this


they don’t have sitemap.xml


so this things are still advantage of hugo


@retrogradeorbit ^ maybe this is useful feedback


I guess you can just generate one like it is done for the rss feed, I guess it's more low level and less opiniated


It does not automatically generate a sitemap.xml, no


the classic static site generators do a lot of stuff for you, but also require you to learn their way and work within it. A bit like a framework.


bootleg is lighter. Its a clojure DSL tailored to processing and transcoding markup. There is no "magic" in it. It's up to you to tie it together however you want. It can be used for more than just static site generation for instance.


I like that


(although I built it for static site generation...)


I think if you want the automatic magic you could choose one of the others. There is also a clojure static site generator more in the vein of those others called cryogen


I was using cryogen before and I found it too limited for my needs. I don’t remember exactly why.

Alex Miller (Clojure team)14:02:27

When I've had the same concerns I found Stasis was a good framework to build on. The site is a stasis static site build


@alexmiller that definitely seems to fit my use case


thanks, I didn’t use this one, but found today too. I will take a look.


it has this downsides of framework


like you mentioned


but yes, I definitely don’t want to code things like sitemap.xml, feed etc. myself


so I expect from the tool a little “magic”


@vikeri I noticed above you mentioned asset optimisation. That is something I am going to add to bootleg next. I want to front my site images with a CDN. And I want to minify images for thumbnails inside the code. So some of this will come soon.

👍 4

I propose we take the static HTML discussion to #off-topic to not bug other Clojure people with this

👍 8

How do I prevent data.csv from creating "\"random-string\"" when a cell item is not a string and others are.


data.csv shouldn’t have any logic to replace cell’s value with some arbitrary string by default. Are you sure this string comes from it?


I have a csv file where everything is in a string. But then there are some that aren’t. The result is rows that look like this ["str-1" ... "\"str-2\"" ...]


When I apply read-csv to is


sounds like your csv file contains something like this foo,"another foo",bar


Yes that’s it.


How does one usually handle this?


in that case data.csv will read "another foo" as a string "\"another foo\"" to keep every bit of information.


The problem I have is converting it to keywords I end up with :"another-foo"


one option could be to apply some transformation logic over result of reading as it written here -


How would I remove the \" ?


(defn normalize [st]
  (clojure.string/replace st #"(^\"|\"$)" ""))

(normalize "\"foo\"")

(normalize "foo")


(defn normalize-csv [csv-data]
  (map #(map normalize %) csv-data))


I definitely need to learn more about regex type stuff


Doesn’t seem to work on the actual csv data.


I think I’m just going to have to use strings 😅


Since your strings can contain spaces (and maybe other characters), going with raw strings and not using keywords sounds just fine.


Yes, if you know all possible values beforehand, and you have a genuine use case, then keywordize.


When you represent an entity as a Clojure map, then it makes most sense to keywordize IMO.


Doing the normalize still gives me this. "\"foo"


It only removes one backslash


The RegEx above will only remove " from the beginning and end of the string. Might it be the other " is not at the end?


^ means beginning and $ means end.


But why not leave it as it is?


Because I can’t do a (get csv-data "foo")


It needs to be normalised


So, these are actually column headers?


Ah, okay. That makes sense.


Replace the RegEx with #"\"" and it will blindly replace all "s.


"�\"foo\"" I’m actually getting this when I copy from the repl to my editor.


Seems to me the detected encoding is incorrect.


Or can it be the byte order mark? There is a section in data.csv README.


And looking at the documentation, it looks like data.csv should remove the quotes for you. Something else is wrong.


I see. That could very well be my problem


I can’t even get the BOMInputStream working 😅


Unable to resolve classname: BOMInputStream
class clojure.lang.Compiler$CompilerException


And when I try to import it with (:import [.input.BOMInputStream]) It fails


I just used clj-bom instead lol


has anyone had any success with using raw bytes as record keys with jackdaw?


sorry I can’t help with this but FYI there is #jackdaw so maybe people can help there

seancorfield17:02:52 Our of curiosity, @alexmiller do you use any automation to figure out the version MAJOR.MINOR.COMMITS?

Alex Miller (Clojure team)17:02:34

yes, it's semi-manual in that it requires running script/build/revision to determine the version. I then use that in the jenkins maven release build step. also, it's important that it uses an initial tag "v0.0" on the first commit in the repo.


Ah, so the ship has sailed somewhat for Contrib projects that never started that way? Basically, all the ones I maintain.


I guess the GitHub UI shows the number of commits so that's a way to seed the version at any point...

Alex Miller (Clojure team)17:02:55

you can tag any commit at any time


Right, I just meant a quick way to get the total number of commits at some point in time.

Noah Bogart17:02:40

git rev-list HEAD --count should work

Alex Miller (Clojure team)17:02:54

it's been on my todo list for a long time to clean this up and fully automate it, but you know, too many things to do

Eduardo Mata17:02:45

what is the most useful tool or function to collect how long a function took to complete its task? I know about the function time

Eduardo Mata17:02:29

I mean, yeah, but I would like something more detailed than just

"Elapsed time: 100.284772 msecs"

Alex Miller (Clojure team)17:02:12

you mean like a profiler?

Eduardo Mata17:02:39

That would be pretty nice

Alex Miller (Clojure team)18:02:51

Java profilers like YourKit work but that's a big hammer


Don't think it works on Windows or WSL. Something to remember.

Eduardo Mata20:02:48

I tried it but the flamegrapsh aren't explanatory to me


there is some explanation of the profiler and its use among one or more posts here, fwiw:

markbastian19:02:45 is pretty solid and easy to use for profiling.

Eduardo Mata21:02:18

I am looking at this Library and compared with Criterium. this seems to produce what I want. Now, I am having a hard time to understand few things. Could you help me?


Not sure how much I can help beyond the docs, but feel free to ask me anything.

Eduardo Mata21:02:02

it is more like, getting the pstats from the profiled form. I am getting a map where the numbers are just integers but tufte printed them in seconds.


Yeah, I always just look at the printed output.

Eduardo Mata20:02:04

What about visualVM?


Also works fine!


Not ready for general announcement yet, but you can try it already: Reveal (Read Eval Visualize Loop)

✔️ 4
🎉 4

Any relationship to this project, other than the high level goals?


yes, was curious about this too 🙂


is it correct that you can use it with either socket repl or nrepl? that sounds pretty neat.


@U47G49KHQ minor point, your instructions say main for socket repl, but perhaps you mean -main? the latter worked here to bring up a window successfully 🙂


wow, great stuff!


(btw, i had some javafx issue with a jdk 8 jvm, but starting a jdk 11 based jvm seemed to fix things)


my wife loves the colors and the deref-ing 👏


Taking a look! > Reveal never touches evaluation results, even the metadata. Can you expand on why this is a problem?


i was curious about that statement too.


@U0CMVHBL2 no relationship other than high level goals :)


@UG1C3AD5Z can you tell me what's the issue on javafx?


i will try to reproduce and post the error


@U45T93RA6 it's a problem because it obscures the values you actually have

👍 4

user=> (require '[vlaaad.reveal.prepl :as vrp])
Syntax error (ClassNotFoundException) compiling at (vlaaad/reveal/font.clj:1:1).


$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b07)
OpenJDK 64-Bit Server VM (build 25.232-b07-jvmci-19.3-b06, mixed mode)


Thanks, I'll have a look!

👍 4

Hey @U47G49KHQ, this looks super interesting! Really excited to see the direction you're taking here 🙂


i am using Calva and trying to get back into clojure in general, but vscode/calva can’t seem to resolve defroutes. what do i need to do to make vscode/calva pick it up?


Not sure, but in case you do not find an answer here, there is a #calva-dev channel that might be a more target rich environment for knowledgeable people.


ah, was thinking that was for contributors, but looks like it is for users too

Eduardo Mata22:02:32

I am using on of the libraries mentioned above (tufte) and the mean is display as 1.286475273E9 how could I evaluate this to an actual number?

Eduardo Mata22:02:07

the type is a double.

Eduardo Mata22:02:22

I answered to myself