Live data from Hacker News

Show HN: Programming Google Flutter with Clojure

github.com

21–30 of 93 posts

Re: Show HN: Programming Google Flutter with Clojure

#21

Earlier quoted context omitted.

How come? What's so bad about dart?

The last time I used Dart, it felt like the worst parts of C# + Java put together somehow. The type system was verbose yet relatively weak in comparison to something like Typescript, it'd already been rewritten once (which isn't a bad thing), and it was almost unusable outside the platform (I remember trying to write tests for something using sqlite.dart and then realizing that you just... couldn't). Flutter is an am…

Dart is at least adding new features relatively quickly (just recently they started working on immutable record data structures with pattern matching, which even TypeScript doesn't have yet) and soon they'll have static metaprogramming meaning you can have Lisp like macros to create your own syntax, including algebraic data types as in any functional language. That is really what people are looking forward to.

Another thing is Dart is JITed, AOT compiled as well as compiling to JS and WASM. Very few languages can do all 4. JVM ones can't, so no Kotlin (we'll see how well Kotlin Native works), and V8 isn't AOT so no JS or TS either. Only alternative I can think of is Lua.

Re: Show HN: Programming Google Flutter with Clojure

#22

Earlier quoted context omitted.

How come? What's so bad about dart?

The last time I used Dart, it felt like the worst parts of C# + Java put together somehow. The type system was verbose yet relatively weak in comparison to something like Typescript, it'd already been rewritten once (which isn't a bad thing), and it was almost unusable outside the platform (I remember trying to write tests for something using sqlite.dart and then realizing that you just... couldn't). Flutter is an am…

I can confirm the experience and I've used dart on multi month projects twice now : first time when it was the JS replacement and using AngularDart back in the angular 2 beta days - it was ahead of the curve at the time with tooling (compared to JS world), but it went nowhere because of poor design choices.

Then they decided to salvage the team and made flutter with it - the technical reasons of chosing it over JS sound extremely unconvincing. And the language is as you say the worst of both worlds - verbose and weak type system (I remember getting runtime type exceptions because compiler couldn't catch a type mismatch in a ternary) and none of JS dynamism, no reflection - just boilerplate on top of boilerplate.

Worst part is the react like architecture of flutter lends itself really well to immutable state management practices but the language is so weak that any immutable library involves a ton of ugly boilerplate - and they refuse to add stuff like records to the language to ameliorate the problem.

The reason it gets me so riled up to rant is that the framework itself and the idea behind it (custom native rendering framework) has potential - but dart makes using it horrible.

Re: Show HN: Programming Google Flutter with Clojure

#23

Interesting! Would love a video including your workflow w/ emulator.

The tl;dr is, on the Mac, (1) start their Simulator app; (2) start a build with watch in the app root directory; and (3) edit code as usual (IntelliJ/Cursive).

The app rebuilds/reloads on save. Tensegritics is looking at better hot reloading; I am happy with automatic full restarts.

Flutter offers a couple of endpoints to visit for debuggers, but I just live off print debugging in the build console.

Video ASAP.

Re: Show HN: Programming Google Flutter with Clojure

#24
post #18
post #8

Earlier quoted context omitted.

Easy, its only purpose to exist is for doing Flutter apps, there is hardly any significat use of Dart outside of Flutter.

It does predate Flutter by five or so years but I do agree that it doesn't have much of a reason to exist outside of that now. I would love to have been a fly on the wall when the decision was made to choose Dart.

Didn't it have something to do with Dart being pushed as Google's pet language? I have heard arguments that it was chosen because TS is Microsoft's pet, while Oracle was having a picnic with Java (this was around the time of the Google-Oracle saga). Dart was seen as a way for Google to be independent of both, and Kotlin wasn't developed yet at the time, hence Flutter went with Dart.

Re: Show HN: Programming Google Flutter with Clojure

#25

Earlier quoted context omitted.

The last time I used Dart, it felt like the worst parts of C# + Java put together somehow. The type system was verbose yet relatively weak in comparison to something like Typescript, it'd already been rewritten once (which isn't a bad thing), and it was almost unusable outside the platform (I remember trying to write tests for something using sqlite.dart and then realizing that you just... couldn't). Flutter is an am…

I can confirm the experience and I've used dart on multi month projects twice now : first time when it was the JS replacement and using AngularDart back in the angular 2 beta days - it was ahead of the curve at the time with tooling (compared to JS world), but it went nowhere because of poor design choices. Then they decided to salvage the team and made flutter with it - the technical reasons of chosing it over JS so…

Oh this totally reminds me of the BLoC pattern[0][1] that everyone kind of... really gritted their teeth through. It just wasn't at all an appealing way to structure data flow and I was kind of surprised that it was the architectural choice that was being pushed.

90% of the time, it felt like simple IoC plus an app-wide singletons would have been enough for most apps-- trying to get everyone to aadopt BLoC was painful and kinda meh. It's probably just that I never developed a sufficiently big app at scale with lots of devs to see why BLoC was the best way.

That said, I'm also reminded of the Boring Flutter Development Show[2], quite possibly the best produced resource I've ever seen as an intro and ongoing guide to a piece of tech. It is excellent.

[0]: https://www.dbestech.com/tutorials/flutter-bloc-pattern-exam...

[1]: https://www.flutterclutter.dev/flutter/basics/what-is-the-bl...

[2]: https://www.youtube.com/watch?v=yr8F2S3Amas&list=PLOU2XLYxms...

Re: Show HN: Programming Google Flutter with Clojure

#26
post #2

With full REPL support etc? (Please say yes, please say yes, please...)

Not yet but we are working on it. Sponsor ClojureDart to make it happen sooner! https://github.com/tensegritics/ClojureDart

FWIW, I tried ClojureDart a little while back, had a good time, but thought to myself, "I'll be back when they have a REPL working." At that time you guys were saying things in the Slack like, "We already have a working prototype behind closed doors, it just needs polish. We'll be ready to release it soon." It was very exciting.

That was... six months ago. :) So... I guess I'll keep waiting.

Re: Show HN: Programming Google Flutter with Clojure

#27

When working with Flutter I did dream "It would be pretty amazing to have a Lisp on top of this" - awesome work you're doing here! Lots of interesting stuff happening in the Clojure space lately. https://github.com/squint-cljs It's a strange thought, but I wonder if Clojure (or rather, the clojure community) would somehow "migrate" from the jvm at this rate.

My dream is Clojure hosted on Rust. It's because Clojure isn't intended to "hide away" the platform underneath and you interact with the platform quite a bit. Since I prefer Rust ergonomics over Java/JVM ergonomics, it'd be awesome to have Rust as a Clojure platform. One day it will happen - if not by me, then by someone else, I'm sure!

I'm sincerely curious about what you have in mind for "clojure hosted on rust".

Rust has a relatively thin runtime, but heavy static compilation work (types and lifetime and borrowing, etc...) , so it kinda seems like a completely different set of tradeoffs than what clojure favors (dynamicity, late bindings, runtime checks, managed memory, etc..)

Or did you mean "a clojure-like syntax for something that produces rust code to be eventually compiled natively ?"

Re: Show HN: Programming Google Flutter with Clojure

#28
post #5

Ah Flutter. I burned a month making silly apps with it, but then I realized that I would probably be better off learning any other programming language than Dart (careerwise at least)

I don't mind Dart, but I'm about a month into Flutter and so far, their approach to UI seems completely insane. It just feels like there's no coherent philosophy backing it.

Re: Show HN: Programming Google Flutter with Clojure

#29

Earlier quoted context omitted.

The last time I used Dart, it felt like the worst parts of C# + Java put together somehow. The type system was verbose yet relatively weak in comparison to something like Typescript, it'd already been rewritten once (which isn't a bad thing), and it was almost unusable outside the platform (I remember trying to write tests for something using sqlite.dart and then realizing that you just... couldn't). Flutter is an am…

I can confirm the experience and I've used dart on multi month projects twice now : first time when it was the JS replacement and using AngularDart back in the angular 2 beta days - it was ahead of the curve at the time with tooling (compared to JS world), but it went nowhere because of poor design choices. Then they decided to salvage the team and made flutter with it - the technical reasons of chosing it over JS so…

With regards to records, you only need to wait for it: https://github.com/dart-lang/sdk/commit/99f60a5e662a7951dd5a...

Re: Show HN: Programming Google Flutter with Clojure

#30
Are you basically saying that I can build my front end using clojure?

I really want to learn clojure and use flutter for a personal project... are there are any reasons not go down this path? (E.g. the "official" implementation of flutter is more secure?, etc.)

Thank you for the cool project

Post reply on HN