News for hackers. Stuff that matters.
Re:State of Clojure 2020 by lkrubner on Thursday February 20, 2020 @09:25PM (#22380467)
EDN is a brilliant literal for data, and since it offers more types than JSON, I would love to see it catch on in the places that now use JSON, especially in APIs. JavaScript has a complicated early history and even though one can use objects as a key value map, it’s not quite a map, in JavaScript. EDN does have the advantage of being a clean implementation of its idea.

On a different topic, I’ve read that almost 50% of computer programming work is just building database views and providing GUIs so non-technical people can interact with databases. Making this work easy used to be a major goal of multiple corporate products. One reason VisualBasic had such a devoted following is that it made it so damn easy for novices to build a GUI for a database.

In recent years the industry has moved towards HTML as the default way to build an interface for anything on a network, but HTML continues to lag when it comes to forms. You have to use a mountain of JavaScript to get the form functionality of VisualBasic. We’ve actually gone backwards on ease of creating database GUIs. Yes, in theory you can use something like React to build forms, but the dev using VisualBasic would be done with the project while you’re still waiting for npm to finish downloading your dependencies. And React requires more skill. VisualBasic had a wonderfully gentle learning curve. Likewise, Ruby On Rails (and other frameworks including Symfony and Django) have scaffolding that allows the fast construction of HTML forms, but, again, HTML is a limited method of building forms.

I’d love to see Clojure succeed in this space, building corporate GUIs for databases. How to do that? Is a new GUI technology needed? Towards that end I’d love to see EDN used as a config language to define a scaffold for forms. There are elements of Swing that worked well and could be rescued from the larger wreckage of Java GUIs. And JavaFX represents a huge “road not taken” for the whole industry.

The tech industry has had eras when it focused on opening the door to beginners. Those eras gave us HyperCard and Flash and VisualBasic. Right now the industry seems to be undergoing an episode of gatekeeping. We are requiring beginners to learn React, which is a big eco-system, and also stuff like Docker, which is tough for beginners. The point of making so much tech mandatory for even simple projects inevitably keeps some people from discovering the joy of programming.

Clojure is the most fun language that I ever worked with, and it’s conceptually simple and it has EDN as a data literal language, all of which is a kindness for beginners. If it also had a simple method for building GUIs I believe it could help lead the industry into the next era when we again focus on making programming accessible for beginners.

Re:State of Clojure 2020 by pcr910303 on Thursday February 20, 2020 @10:44PM (#22380781)
> I’d love to see Clojure succeed in this space, building corporate GUIs for databases.

Looks like you’re finding HyperFiddle[0].

Quoting from the website:

> Low-code databases, developer-grade

> Hyperfiddle lets you make lightweight database applications out of just database queries.

It’s Clojure based, uses the EDN notation, and doesn’t require writing a lot of code. It basically translates the Datomic database[1] queries into tables (which can be exported to react components and styled appropriately).

[0] http://www.hyperfiddle.net/

[1] https://www.datomic.com/

Re:State of Clojure 2020 by lkrubner on Friday February 21, 2020 @11:09AM (#22384154)
No, Hyperfiddle is exactly what I think we need to get away from. This is from their introductory blog post:

"For a high-end UI, use React.js. The above cryptocurrency invoicing MVP generates QR codes using a javascript module from github. This blog post is a hyperfiddle and includes React.js components, CSS, HTML5 video components, mailchimp & twitter integrations"

Hyperfiddle is basic scaffolding of the type we've had for 15 years thanks to Ruby On Rails. I'm suggesting it would be good if we could get beyond this level, since we have been stuck at this level for a long time.

Hyperfiddle does use EDN for configuration, and I really like that part of it, but it's still using HTML, which, as I said above, doesn't give us the form functionality that VisualBasic did.

Re:State of Clojure 2020 by geokon on Thursday February 20, 2020 @09:43PM (#22380542)
I suggest taking a look at Cljfx

https://github.com/cljfx/cljfx

It's built around JFX, but it's very Clojure-y (much more than the alternate Swing library). I've been making small GUIs with it and it's convenient and "just works". The only issue I've had is when some callback blows up somewhere in the guts you don't get clean call stacks so it's very hard to debug, but then.. isn't most GUI code? You just need to work incrementally which is easy to do with a REPL

Re:State of Clojure 2020 by lvh on Thursday February 20, 2020 @10:53PM (#22380821)
Huh! I've previously only used fn-fx. Any chance you've used both?
Re:State of Clojure 2020 by geokon on Friday February 21, 2020 @04:11AM (#22381877)
Yeah, I actually used fn-fx at first but it's quite complicated internally and semi-unmaintained. I found some bugs/issues and I couldn't figure out how to fix them. Then the project was taken over by a new maintainer but he admitted that he didn't really know how the system works or how to fix it. I similarly read a comment from the cljfx creator that he started the project b/c he didn't know how fn-fx works and how to add to it.

I also wanna say that the CLJFX maintainer is very friendly and responsive and he's been very helpful with all my dumb questions. I thought it's be one of those libraries that gets "finished" and then archived, but he's been keeping at it and releasing new versions for a long while now

The design-paradigm is essentially the same (React-style). You still have a state atom and you're still making a map structure of your GUI elements and then hooking up callbacks to events. I find it's really easy to use, but at the same time I have to admit I don't really get how it works or how to debug the system. It's a bit of a black box for me. You feed in a data structure and it make a GUI for you and functions get called when stuff happen/changes.

Re:State of Clojure 2020 by samatman on Thursday February 20, 2020 @10:04PM (#22380633)
Metabase is focused on analytics, which is in a way the dual of forms: https://github.com/metabase/metabase

Clojure has great potential for what you're describing.

Re:State of Clojure 2020 by uryga on Thursday February 20, 2020 @11:25PM (#22380942)
could you explain "analytics are the dual of forms" a bit? sounds intriguing!
Re:State of Clojure 2020 by samatman on Friday February 21, 2020 @12:43AM (#22381174)
Ah that was just a bit of a rhetorical flourish.

Forms put data into databases, analytics take it out and do stuff with it. That's kinda like a dual, if you squint and wave your hands enough.

Where VBA is concerned, forms to put data into the database, and analysis/report programs that take it out again, have always been the main use cases.

Re:State of Clojure 2020 by emmanueloga_ on Thursday February 20, 2020 @10:35PM (#22380743)
So, if I get it right, from your comment:

1) You like EDN and would like it to become popular.

2) You would like Clojure to occupy a similar place RAD and 4th gen languages tried to occupy decades back. Not saying this in pejorative way, since I'm sure a big chunk of HN has come to appreciate VB a lot more now that is not such a big thing as it was in the past.

--

Regarding 1), I feel like it is a little bit hard that EDN will become popular, mostly since it goes so much hand in hand with Clojure and its APIs. Plus, in order to talk EDN to browsers, it makes sense to pack it in JSON and then use some clever encoding (like [transit] does). One of the tricky parts of using ClojureScript is understanding the handling of data coming from APIs.. I'm only now starting to get into this but I think is not trivial, and this is why projects like [cljs-bean] exist.

--

Regarding 2), I'm also not sure that the same target market that embraced visual basic and continue to use it will really ever be very happy with Clojure and its ecosystem, since there's not too much emphasis in making things plug and play, is more like a choose-your-own-adventure community :-). I guess it would require a very nice package to market it, the way rails did with ruby.

--

transit: https://github.com/cognitect/transit-format

cljs-bean: https://github.com/mfikes/cljs-bean

Re:State of Clojure 2020 by tincholio on Friday February 21, 2020 @01:59AM (#22381412)
As for the 4G low-code approach, Fulcro RAD (currently in preview [1]) seems to go in this direction, only web-based.

[1] https://www.youtube.com/watch?v=jkx9F-RIFiY

Re:State of Clojure 2020 by thosmos on Friday February 21, 2020 @05:12PM (#22387446)
It's still in experimental pre-alpha, and it has a lot of potential https://github.com/fulcrologic/fulcro-rad