This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-26
Channels
- # aleph (9)
- # announcements (31)
- # babashka (23)
- # beginners (35)
- # biff (2)
- # calva (5)
- # cider (10)
- # clara (11)
- # clerk (114)
- # clj-kondo (18)
- # cljdoc (37)
- # clojars (7)
- # clojure (24)
- # clojure-austin (10)
- # clojure-europe (27)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (2)
- # clojurescript (18)
- # conjure (2)
- # core-async (6)
- # cursive (21)
- # datomic (3)
- # fulcro (15)
- # introduce-yourself (7)
- # lsp (32)
- # malli (57)
- # meander (5)
- # music (1)
- # nbb (2)
- # off-topic (17)
- # pathom (6)
- # rdf (4)
- # reagent (8)
- # releases (2)
- # shadow-cljs (4)
- # slack-help (23)
- # spacemacs (6)
- # tools-build (32)
Look ma, I will try to use (a customized) Clerk to build proper documentation (https://recife.pfeodrippe.com) for https://github.com/pfeodrippe/recife. No gap between code and documentation, they are only one now, think -> write. I will also try to blog using Clerk, it seems that we can go pretty far with it hauaheuuaeh
Yep, not supporting mobile very well yet, thanks for the report o/ Need to work on responsiveness
This piece of code stops rendering Clerk (resulting page is empty)
(clerk/html
[:div (list [:div 1] [:div 2] [:div 3])])
Another question related to github pages (default settings). Clerk stores images in _data
folder, looks like it's not propagated to the pages, anyone knows how to fix that?
the folder is here: https://github.com/Clojure2D/clojure2d/tree/master/docs/notebooks/_data
Hi,
I'm looking for component/solution where I can transform malli
schema to clerk
to document the schema/spec in html format... This is just a start but ultimate need is to convert it to something I can publish in confluent wiki
@sritchie09 https://twitter.com/borkdude/status/1618738758819655680 I know you're not on the bird site anymore, but here you go. Perhaps the answer is emmy + clerk?
Yeah I think so!! @dustingetz that’s exactly what I’ve been building all these pieces for. For 2d check out http://Jsxgraph.Mentat.org http://Mafs.Mentat.org Those plus functions in Emmy is a pretty powerful combo https://github.com/mentat-collective/emmy
this looks great
https://nextjournal.com/try/samritchie/emmy this link is dead, do you have the working link
you guys have done a lot of work on this!
@dustingetz some fallout from my find and replace…
@dustingetz another piece of the puzzle is http://mathlive.Mentat.orghttp://mathlive.Mentat.orghttp://mathlive.Mentat.org … that will parse into Emmy code so you can enter or edit your clj functions in an equation editor . Lots of work, should make for a nice experience once it’s all sewn together!
I'm having trouble quickly grasping what the vision is, what the elements are, how they connect and what exactly works today. Could you make like a gist that lists these?
Sure: • Emmy: computer algebra system based on the idea of extensible, generic mathematical functions (basically multimethod-based), and a ton of different mathematical data types that implement the multimethods and all work together. ◦ then a bunch of code built on that like automatic differentiation, numerical integration, ODE solvers, symbolic equation simplifiers, ◦ function compilers that take advantage of the multimethod flexibility to compile code => js, => JVM, to WebGL, etc ◦ different renderers for all of the types, so I can print equations as TeX etc ◦ classical mechanics package built on top of all of this ◦ differential geometry ◦ special and general relativity code ◦ this all powers two large, advanced physics textbooks… then all of the other libraries exist for me to plug in “viewers” for these mathematical data types
• https://github.com/mentat-collective/jsxgraph.cljs - 2d geometry package, https://jsxgraph.mentat.org • https://github.com/mentat-collective/mathbox.cljs - insane 3d webgl visualizations, https://mathbox.mentat.org • https://github.com/mentat-collective/mathlive.cljs - equation editor for writing /rendering math without s-expressions, https://mathlive.mentat.org • https://github.com/mentat-collective/mafs.cljs - 2d geometry package based on SVG, https://mafs.mentat.org • https://github.com/mentat-collective/leva.cljs - control panels to tweak parameters for any / all of this, https://leva.mentat.org
and all of those are available as their own, nothing-to-do-with-emmy packages, where the pages linked above should be pretty self-explanatory? way beyond self-explanatory if I did my job right with the docs
and then clerk coordinates all of this and turns it into open-source Mathematica
@dustingetz lmk if that clears up the vision… If you want a more text-y vision, I’m still mostly trying to get this idea working: https://roadtoreality.substack.com/p/the-dynamic-notebook
I tried to clean it into a coherent statement of what you have, this is as far as i got in the time i had if it's helpful - https://gist.github.com/dustingetz/e2b734627e275d32204c5a8e7c62249d
Nice! And I hear the suggestion that I post this :)
@dustingetz so what do you think? are you down to give this toolkit a try for your mathematical explorations?
@dustingetz it was really just this past week that I think I’ve cracked the code on how to make all of this stuff really easy to use together. the algebra system by itself is very solid for “real work”… but it’s very weird for anyone not in the Clojure world. the algebra system PLUS these visualizers becomes something more powerful than anything else out there, imo
i'd like to try it rather than learn mathematica or sagemath which is janky AF, im not quite sure where to start
@dustingetz I’m happy to help! I would say the thing to start with is a Clerk project with Emmy as a dependency, as well as whichever of these viewer libraries you want to try
making this easy is my project this week, incidentally. but the clerk/custom
template here is a good first step: https://github.com/nextjournal/clerk-cljs-demo
and then here is an example of a clerk notebook that goes to town with some generic math code: https://github.com/nextjournal/clerk-demo/blob/main/notebooks/sicmutils.clj
change “sicmutils” to “emmy” 🙂
here’s the rendered version: https://github.clerk.garden/nextjournal/clerk-demo/commit/45271b7060cd54b8298300d59a07dbec037dfeaf/notebooks/sicmutils.html
do you have a clerk link i can fork
it's a clj lib not cljs, right?
@dustingetz if you tell me what you want to do, I can get you a hello world repo set up, sure
ah clerk isn't nextjournal i forgot
@dustingetz but if you run the command for that template you’ll get something really good
want to give that a try?
so the best way to get started is to clone this https://github.com/nextjournal/clerk-demo/ and use the sicmutils demo?
that would do it, but if you want to play with the new visualization stuff I’d recommend following the directions at https://github.com/nextjournal/clerk-cljs-demo and making a new project with the clerk/custom
template
early this week I can get some more Batteries Included for you, and make an Emmy specific project template
what is the difference between emmy and scimutil?
but lmk what you want to play with, like “I really want some math graphs that animate”, or “I want to figure out what the heck an ODE is”, and I can help tune
i'm following youtube playlists on complex analysis and linear algebra intro
@dustingetz “sicmutils” was the original name for the project, but now 2 years into coding, I’ve ported basically the entire algebra system from Sussman’s original work, and with these visualizers etc it’s much more general than “utilities for Structure and Interpretation of Classical Mechanics” (SICM)”
ok so emmy is the rebrand
so I forked my own project, and once I get Emmy released I’ll make sicmutils into a single namespace, sicmutils.env
, that depends on emmy, basically gutting it
sicmutils is a clojure port of a system built by Sussman?
yeah, give the readme a scan https://github.com/mentat-collective/emmy
@dustingetz I think this is what you are looking for: https://cljdoc.org/d/sicmutils/sicmutils/0.22.0/doc/reference-manual
@dustingetz but yes, Sussman has a system called “scmutils” that he started in the late 80s that backs his two physics textbooks. it’s a huge MIT scheme library, 60k lines or so that pioneered a bunch of stuff like autodiff
@dustingetz I mean the EASIEST way to get started is to get the dependency and then run (require '[emmy.env :use :all])
I still don’t have all of this sewn together into an ultra-easy-to-use package, clearly. that’s the next project, getting Emmy sewn in with these math visualization libraries
Ok I made some progress in the docs: https://gist.github.com/dustingetz/e2b734627e275d32204c5a8e7c62249d
what is lost by a naked deps.edn setup with (require '[emmy.env :use :all])
?
web rendering?
Basically TeX rendering
Not sure if you’ve used Clerk yet but Clerk actually just watches an existing namespace, so you don’t do anything different to use clerk
Just start it and then it can render the TeX etc in its web view
I got this error following the clerk cljs demo steps:
Execution error (ExceptionInfo) at org.corfield.new/create (new.clj:74).
notebooks already exists (and :overwrite was not true).
it's a fresh clonei blindly pasted this, is the hardcoded sha intended?
clojure -Sdeps '{:deps {io.github.nextjournal/clerk-cljs-demo {:git/sha "b805370715fdcaf34f6a9d6cb2efc2b12153c90c"}}}' \
-Tnew create \
:template clerk/custom \
:name myusername/notebooks
Sounds like the folder “notebooks” already exists
But yeah change to the latest SHA also!
ah, it does indeed exist but i didnt put it there
And pick a new name so it goes in a different folder
Or delete the existing notebooks folder
ok, i have the template
how do i run it?
Look at the generated readme
I think i added notes there
notebooks % bb start-clerk
Downloading pod clj-kondo/clj-kondo (2023.01.20)
Successfully installed pod clj-kondo/clj-kondo (2023.01.20)
----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: File does not exist: start-clerk
(I'm seeing a lot of this for the first time sorry, i am old school clojure i guess)
Haha me too, just trying to get something easy to use together for newer folks
As you can see this isn’t done yet
i'm tracking the install steps in the gist btw
Thank you!
This doesn’t have any of the stuff you want in here yet, just the infrastructure to add it
I’m spending tomorrow on this, by the end of the week it should be solid
gotcha
ok i have clerk up is there a hello world i can try
to render some math or something
ah the sicmutils demo
boom math !!!
Hey, amazing!
I wrote a lot of the library as literate essays that I’ll publish with clerk - that is part of the goal, for the library to BE a textbook
But if you look through the source of types you’re interested in you’ll find a ton of exposition
Alright, here is the final doc that gets through hello math world - https://gist.github.com/dustingetz/e2b734627e275d32204c5a8e7c62249d
do you have a channel for emmy?
Currently using #C01ECA9AA74 or #C041G9B1AAK , I’ll convert #C01ECA9AA74 once I finish the port
The improvements I have planned will let you, for example, pass a function written in generics, full of derivatives etc but have the graphing component compile the function to JS on mount so the graph runs smoking fast
@dustingetz but I’m here for this, so if you do go down this path please lean on me, or better yet let’s write some math together
I went further with my Clerk integration into cider-inspector
Here are three EmacsLisp functions for Cider which can be used as followed:
https://gist.github.com/behrica/7bacf8a59021336f17027009a46eff9c#file-cider-inspector-tap-with-clerk-viewer-clj
1. clerk-open-tap-inspector
to open Clerk tap-inspector
2. clerk-set-current-viewers
to set the current viewer names of Clerk into a Emacs variable
3. When in cider-inspector
you can now call cider-inspector-tap-current-val-with-clerk-viewer
to first interactively select a "Clerk viewer" (by :name) and it will then send the current value to the tap inspector in browser rendered with the selected viewer
This is super convenient to use Clerk as a REPL companion, special when the functions above gets key mappings. The drill down of cider-inspector
and Clerk's rich rendering capabilities play very well together.
where can I learn more about the viewer names (seems I need that to hook everything together)
On this Clerk is not very clear yet. Some viewers have a :name, some not. A kind of list is here: https://github.com/nextjournal/clerk/blob/main/src/nextjournal/clerk/viewer.cljc Maybe @U5H74UNSF can bring a bit of light in this.