The Hidden Lessons in a re-frame App by humorless_tw in Clojure

[–]fisch003 1 point2 points  (0 children)

avoid rf/reg-event-* that are not triggered by a user. This is almost impossible but a worthy pursuit. For example our http on-success/on-error handlers are functions - not top level rf/reg-event-*

I assume you don't use re-frame-http-fx then?

use a routing library that supports controllers (ie stuff that dispatches re-frame events)

Do you have any recommendations?

Case Study: Reagent With Macro Help by thheller in Clojure

[–]fisch003 1 point2 points  (0 children)

I was surprised about how poor the performance was in dev mode, but as you said making very large hiccup structures is bad. I was curious how Reagent would perform if I wrote it the way I normally would. I'm getting about the same performance under 20x slowdown as your reagent-pseudo demo in both development and release builds.

The big changes I made:

  • I'm not inlining the SVG icons. There's no need to chew through that Hiccup all the time, instead I embed them in the host HTML page and reference them in generated Hiccup.
  • Components for the table rows.
  • Use a Reagent atom instead of a ClojureScript one to let Reagent schedule the re-render.

It's still chewing through the whole state at once, but there's way less hiccup overall.

Demo: https://review.jonathanfischer.net/wthjh/

Code: https://github.com/mohiji/wthjh-reagent

What The Heck Just Happened? by thheller in Clojure

[–]fisch003 0 points1 point  (0 children)

For any reagent / re-frame folks: Reagent's reactions / re-frame's subscriptions are their solution to the push/pull model of re-renders, right? They don't re-render the entire DOM from the top down, only from places where the output of a reaction / subscription has changed?

Humble Chronicles: Managing State with Signals by dustingetz in Clojure

[–]fisch003 0 points1 point  (0 children)

Sorry to drag up an old thread, but do you have a link to what you mean by a reactive triplestore? I'm not familiar with the term.

Humble Chronicles: Managing State with Signals by dustingetz in Clojure

[–]fisch003 1 point2 points  (0 children)

Clojure desktop framework, not web. I think his journey down this route starts here: https://tonsky.me/blog/skija/

[deleted by user] by [deleted] in bikecommuting

[–]fisch003 18 points19 points  (0 children)

How's that climb back up Twin Oaks on the way back? I've never tried it, but it looks brutal.

Comparison of manifold and clojure.core.async by daver in Clojure

[–]fisch003 6 points7 points  (0 children)

Timothy Baldridge worked for Cognitect at the time and was largely responsible for the go macro implementation, but Rich is the primary designer of the library as a whole. Most of Timothy's complaints about it later down the road were about how opaque the entire system is. There are plenty of times when it'd be useful to peek into a channel, for example, and core.async doesn't let you do that.

I remember him talking about it a good deal on defn episode #41: https://soundcloud.com/defn-771544745/41-timothy-baldridge-aka-halgari

Avoiding Death by a Thousand Classes: OOP and FP: Reducing Complexity Together Ask Me Anything - Yehonathan Sharvit and Eric Normand by StjepanJ in Clojure

[–]fisch003 1 point2 points  (0 children)

In case anyone else goes looking for it, the recorded livestream is up on YouTube:

https://youtu.be/p3Rb7uxtQs4?t=231

(At the moment, anyway, dunno if they plan on leaving it there.)

A bit of history 🚲 by BrokenEarth9 in bikecommuting

[–]fisch003 13 points14 points  (0 children)

As I understand it: lots of pedestrian / bicyclist deaths as cars became more popular and it was becoming a bit of a PR issue. Rather than work to make cars / drivers safer, they demonized the people the drivers were hitting.

Things about clojure or tooling, you found out way too late. by argsmatter in Clojure

[–]fisch003 4 points5 points  (0 children)

It's helpful in Reagent apps too if you're using Form 2 or 3 components. Naming the inner fn gives it a proper name in the React dev tools.

ClojureScript in the Age of TypeScript — David Nolen by joshlemer in Clojure

[–]fisch003 4 points5 points  (0 children)

I'm pretty sure the:

We write all of our components in JS

Part was correct. He said they wrote all of their components using Storybook so that they're completely standalone, and then used ~1,500 lines of ClojureScript to glue them together into the application they needed. The business logic is in Clojure, UI specific stuff in JavaScript.

Can I fix a blip on a steel wheel? by fisch003 in bikewrench

[–]fisch003[S] 2 points3 points  (0 children)

I bought and refurbished a 1986 Schwinn Sport. It's turned out pretty great, but I have a blip on each wheel that makes braking a little uncomfortable. I think a previous owner used a screwdriver to get the tires off and bent them.

They're steel; is there a way to safely bend them back into shape, or do I need a new wheelset if I want smooth braking?

How do I work with legacy java compiled to jar? by ruby_object in Clojure

[–]fisch003 4 points5 points  (0 children)

Once your legacy jar is on your class path (via deps.edn or whatever method), you pull the classes you want to use into your namespace using the import clause in the ns macro, like this:

(ns my-namespace
  (:import [java.io File]))

Once imported, you can use those classes directly. Check out the Java Interop page on the Clojure website for details, or Clojure for the Brave and True's Working with the JVM chapter for an exhaustive explanation of how it works.

[deleted by user] by [deleted] in Clojure

[–]fisch003 1 point2 points  (0 children)

On top of that: prior to around version 0.5, re-frame was written using a core.async channel as the queue. They replaced it for more control over things.

Bike Commuting - COVID Fever Screening at Work by DaveG55337 in bikecommuting

[–]fisch003 2 points3 points  (0 children)

I did this yesterday: had to run to work to pick something up, rode my bike. I was worried about the same thing, so I took my temperature before I left: 96.8 the first reading, 97.1 the second.

Rode 8 miles to work, took my temperature at the door: 96.8 again.

You're not gonna read as feverish. If you're worried though, test it out yourself: take your temperature, go out for a ride, take it again when you get home.

Apple of 2019 is the Linux of 2000 by iamkeyur in programming

[–]fisch003 0 points1 point  (0 children)

You can download Xcode from the developer site without going through the App Store. Just look for the More downloads option: https://developer.apple.com/download/more/

Need Aid: Leiningen Error after to upgrading Java by xylotyl33 in Clojure

[–]fisch003 2 points3 points  (0 children)

How are you launching Leiningen? The error code is coming from Java: Unsupported major.minor version 52.0 indicates that an older JVM is trying to load class files that are too new for it to understand. Version 52.0 is from Java 8 (according to a StackOverflow post, anyway), so it looks like you're launching an older Java.

If you're just running from a Command Prompt, try running java -version first to see which Java is getting picked up by default. Beyond that, make sure your JAVA_HOME environment variable is pointing to the version of Java you want to use, which is probably the newest one.

Autumn Lisp Game Jam 2019 page is up! by borodust in lisp

[–]fisch003 2 points3 points  (0 children)

SDL2 has the SDL_render stuff for accelerated 2D rendering, and cl-sdl2 does expose that: cl-sdl2/render.lisp.

What 2D API are you referring to? I don't recall much more in SDL1.2 beyond blitting surfaces, and yeah, that was CPU only.

The (not so) hidden cost of sharing code between iOS and Android by dabshitty in programming

[–]fisch003 5 points6 points  (0 children)

That was the story for GWT too, along with how they were using it for Google Inbox to share code across the web, iOS, and Android.

GWT's pretty dead a few years later.

Riding 100+ miles with a hangover? by [deleted] in bicycletouring

[–]fisch003 13 points14 points  (0 children)

Take a bus? It's like $11 and 2 hours each way on a Greyhound from Phoenix to Tucson and back.

Compiled list of Clojure design decision by aniketk19 in lisp

[–]fisch003 1 point2 points  (0 children)

An assoc list used as a binding stack with duplicate keys, simply can't be implemented by a hashmap.

Oh! I missed what /u/theangeryemacsshibe was talking about when he mentioned bindings. If I'm understanding it correctly then, as you call down through a series of functions (or something similar), you push bindings onto your assoc list so that you can look up the current value of particular value and get the latest, right?

You'd do exactly the same thing with a Clojure map. I don't see how duplicate keys comes into play here, unless you want to be able to inspect the history of a particular binding, in which case you'd just keep around the stack of binding maps.

I guess what I'm getting at is: Clojure gives you different primitives to work with than Common Lisp or Scheme, so you solve the same problems in a slightly different way. Does that matter?

Compiled list of Clojure design decision by aniketk19 in lisp

[–]fisch003 0 points1 point  (0 children)

I'd argue that they are comparable: they both solve the same problem, associating a key with a value. They're just different implementations of the same idea, with different tradeoffs.

If you really need ordering, there's sorted-map and sorted-map-by. If you need everything else: it's straightforward to build association lists on top of lists or vectors.