scheme, common lisp, and elisp can be more elegant because they don't triangulate between lispiness, interop with a vm made for another language, and hardware
they also lack the wonderful library support we get "for free" by designing around the off the shelf vm
(the consequences are funny - eg. a well maintained java library with no clojure interop except in app specific code is more secure than a one-off poorly supported clojure wrapper) (this is funny because "don't roll your own" is security lesson 0)
I feel Clojure is one of, if not the most, practical lisp but I’ve been slowly picking up emacs-lisp while configuring Emacs with doom-emacs. It’s useful for making emacs feel just right to me as well as interesting to see what a lisp is like without the emphasis on functional principles. I feel Clojure is a lot better to work with and easier to mentally understand quickly with immutability as a default. Some of these elisp functions are gigantic and get quite complex with the mutable state. Despite that though, there’s many customizations that would take several hundred LOC in say VS Code that can be done in like 5 lines of elisp. But trying to customize JS indentation though is like drunkenly wandering through a funhouse mirror maze with the lights off.
What would be the fastest way to find all disjoint supersets of many smaller sets? My google-fu helped me to find solutions for the opposite problem - superset decomposition/partitioning. And my intuition tells me that I can just use an algorithm for finding all components of a graph (where an input set represents a fully connected graph), but I'm not sure that's the best approach.
Just to make what I want more clear. Suppose I have sets #{1, 2, 3}
, #{2, 3, 4}
, #{7, 8, 9}
, #{9, 10}
. I want to end up with #{1, 2, 3, 4}
and #{7, 8, 9, 10}
since the first two sets both have 2 and 3 and the last two sets both have 9.
The http://clojurians.net/ website seems to in error state right now.
1. give each set an ID (it may work faster than to test set equality each time) 2. Build an index element -> set of set-ids 3. Use the index to connect all your graphs. You should find an algorithm which is close to linear w.r.t. the total number of elements.
the algorithm is indeed a graph component painting
Thanks!
That’s also based on my intuition.
At that point, I would use Google, no need to re-invent the wheel.
Indeed. :) The idea that graph component painting may be done in linear time makes inventing something else unnecessary since I highly doubt a more efficient algorithm is possible. But of course I may be wrong.
When I was young, I found an algorithm to solve this problem in n * log_2(n) for the worst case scenario, so I think it’s either this or faster via hash-maps which I did not consider at that time.
on internet, people call it graph component labeling
I found that: https://en.wikipedia.org/wiki/Connected-component_labeling
Awesome, thanks! "Connected-component labeling (CCL), connected-component analysis (CCA), blob extraction, region labeling, blob discovery, or region extraction" - huh, that's a lot of names.
I think that the link between your problem and the connected-component labeling is where you have elements which belong to multiple sets at the same time. The index I mentioned let you know about those elements.
Indeed.
I think the graph in your case is a hashmap of set-id -> set of set-ids
the elements in the sets are not important at that point.
From that Wiki page I found out about https://github.com/prittt/YACCLAB and oh boy is it a rabbit hole.
“The best is the enemy of the good”. I suggest to pick a solution good enough and move to your next task :-)
That's exactly what I'm about to do. :) Already found that https://github.com/aysylu/loom has an implementation for that. I'll just make sure that it has good enough timing for the data sizes that I have.
@mauricio.szabo I was talking specifically about issues that are not related to the app. I have even listed them explicitly. Do you really think using Clojure would somehow help you avoid those issues?
Maybe some parts. For example, Facebook login would probably not need an upgrade from clojure then ring/pedestal/whatever. Then, he would not need to upgrade the server, for example. But yeah, other issues would arise in the same way. That's the parts we agree :)
"my server is too old. So now I'm upgrading Ubuntu." - the main issue is that he has chosen the most arduous path. He just reaped what he has sown. Also there's a mixed talk about macOS and Ubuntu - I have no idea what the initial message author is doing.
And to be fair, most of the issues that author describes would manifest in the exact same way with Clojure. Simply because the issues come from outside of the application. Like Facebook API, SSL certificates, HTTPS on localhost, MongoDB not working, migrating from SysV to Upstart.
Co-incidentally I just wanted to make a small tweak to my blog, which is based on octopress / Ruby, but I had to set up rvm all over again and figure things out for the nth time, probably because I'm only touching this once or twice a year
I switched to croygen because I didn't want to waste time on these types of issues.
yes, I should switch too
A badge of honor to have a project live that long
Cryogen looks nice, having a look
I've used hugo for a while which works well enough too
I'm still waiting for spec2 to stabilize, so I can convert my mini cms project for a blog/personnal site. Been 2 years, but should be fine I guess.
i'm re watching phillip walders "categories for the working hacker" and he has this example (see picture). Anyone clear on what "h" is here? I can't imagine this is a typo of some sorts but right now the best i can tell is that he should have written id_C. That C appears in the top picture but not in the bottom is also confusing. https://youtu.be/gui_SE8rJUM?t=484
He does say in the video “say that h goes from C to D”, so I think Sean is spot on. Ended up watching the whole thing, Phil is a great teacher. It brought me to “the First Monad tutorial” https://youtu.be/yjmKMhJOJos I’m finally reaching the point of understanding monads, and watching this had me wondering “sure, but how do I compose them??”. After some searching I found “monad transformers” and once again am completely intimidated 😅 To track state and output to the console and potentially fail, the types in Haskell become gnarly pretty quickly.
I don't know any CT, but h seems to be a function, just like f and g. The bottom line just shows how function composition works (i.e. (comp (comp f1 f2) f3)
is the same as (comp f1 (comp f2 f3))
)
I was gonna say, it just looks like he's showing that function composition is associative, in that if you have a series of function to compose, like f g h You can start composing the individual functions together (to eventually form the final big composed function) in any which order; first combining f and g for instance, and then composing that with h, or first composing g and h, and composing the resulting function with f
Well, if we're speaking categories, I guess those aren't functions
Its been a while, I suppose those'd be morphisms / arrows?
That is what i believe is being communicated here cameron. But H is a symbol that doesn't appear in the arrow and object model unlike any other symbol. It's easier for me to assume that i'm missing something then he didn't translate it correctly.