off-topic 2026-01-29

Never seen anyone who claims they develop Typescript apps functional style. https://lambda.hothire.dev/profile/pantagruel74 Wondering how many of you use purely use functional style to develop code even if your language is OOP?

๐Ÿ‘ 1

Not pure but I try When I write Python it's mostly immutable data classes, interfaces and functions. I rarely reach for a regular old class. Heck, I even ported the component framework to python to abstract some messy OO and mutability away

๐Ÿ‘ 2

We try as much as possible in our ts codebase. The newer functional code is an order of magnitude easier to reason about.

๐Ÿ‘ 1

I mostly did functional Js and Ts before changing to Clojure. One constant grief was that same team always had OOP and functional people.

Agree with the others: I try as much as possible, but when mutable data structures are a core part of the language, some mutations inevitably slip through the cracks.

I'll reiterate what other said: immutability, idempotence and pure functions can be used in all languages. BTW, TS is not an OOP language, even though lots of people use it as if it is.

One could argue TS is not a language at all

One could argue that a thing that has a compiler is a language?

I'm just adopting the cheeky position TS is a linter not a language. Curiously the type system is a language ๐Ÿ˜

Fair ๐Ÿ™‚

I worked for a startup that went all-in in functional javascript, as in probably not a single let in the codebase, and using RamdaJS for everything. https://ramdajs.com/docs

Our 150K lines of JS at work is fairly functional in style so it isn't too horribly foreign for me when I need to work on the front end instead of our 150K lines of Clojure on the backend. We were lucky that the front end team we hired, years ago, preferred the functional style and immutable data where appropriate.

This is the way. And in TS you can actually enforce that via the readonly access modifier in interface member definitions, as well as the Readonly utility type. Unfortunately, this isn't automatic and has to rely on a heavy use of conventions and lint rules.

๐Ÿ‘ 1

Not TS, but I like using immutable-js in javascript to be more like Clojure, but I find that I use fromJS and toJS a lot with no method to that madness

Yup, we use Immutable.js quite a lot.

๐Ÿ‘ 1

Ugh, Immutable.js is so nasty to use. Have you considered immer as a (partial) replacement?

Given how much code we have (and how few resources we have to maintain it), no ๐Ÿ™‚

๐Ÿ‘ 1

Ugh, Immutable.js is so nasty to use. Have you considered immer as a (partial) replacement?
didn't know about it. I'll check into it

๐Ÿ‘ 1

At work our frontend is in React/TypeScript and I don't think we have a single JS class across the entire app. As others have mentioned I have never thought of JS/TS as an OO language. Eloquent JavaScript was one of the first programming books I ever read, and introduced me to the concept of higher-order functions before I had even heard of functional programming. That was back before JS class syntax was widely supported. :)

๐ŸŽฏ 3

๐Ÿ‘€ https://github.com/chaploud/ClojureWasmBeta

4
โ— 4
๐Ÿฏ 1
๐Ÿ˜ฎ 6

Thanks for your interest in ClojureWasmBeta ๐Ÿ’  An official English version of ClojureWasm has recently been published. Itโ€™s currently in a pre-alpha stage. If youโ€™re interested, feel free to take a look. Iโ€™m not very active on Slack, so responses there might be slow. https://github.com/clojurewasm/ClojureWasm

โค๏ธ 4

Whoah! Is this kinda like Jank but for Zig?

yeah I don't know, I don't speak Japanese. Does it offer Zig / C interop?

i don't see any mention of c interop. just an explicit policy of not doing jvm interop.

this is one of the few languages i can read ๐Ÿ™‚

1

there is quite a bit of detail in the docs and plan directories

looks like there might have been a presentation within the last day

I don't see Zig interop mentioned either...

โœ… 1

that's how I discovered this, via a mention of the word babashka on social media

๐Ÿ‘ 1

the author speaks highly of babashka ๐Ÿ™‚

1

oh does he? then I want to hear more ;)

2

(or she, etc)

lol -- somehow that link doesn't work where i am but i do see the equivalent of "wasminterop yes" in the babashka comparison table

will probably take a look more later. gotta hit the sack ๐Ÿ™‚ take care!

Goodnight @sogaiu!

๐Ÿ‘‹ 1

Google translated nice things about Babashka (from https://github-com.translate.goog/chaploud/ClojureWasmBeta/blob/main/docs/presentation/qa_cheatsheet.md?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp) > Wouldn't Babashka be okay? > โ€ข Babashka is a great tool and there is some overlap in usage. > โ€ข Differentiation: WasmInterop and extremely lightweight (2MB memory) > โ€ข Not a competitor, but a niche: Babashka is strong in situations where you want to use Java library assets

๐Ÿ‘ 1

> This repository is intended for experimental and research use. A more formal project with complete English documentation will be published separately in the future. via: https://github.com/chaploud/ClojureWasmBeta/commit/d3c15ac40d106efd0bb33ea83c242105d160c73c

๐Ÿ‘ 2