Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Ur Programming Language (impredicative.com)
126 points by Tomte on Jan 27, 2024 | hide | past | favorite | 44 comments


Ur/Web has some incredible ideas. The main ones being:

* HTML fragment type and literals. It's analogous to React's JSX and helps you write statically-checked and type-safe HTML.

* SQL literals. Sort of like LINQ in C#. This ensures that your SQL is statically checked, so you can't end up with invalid queries at runtime, and type-safe.

* Allows you to write client side code in Ur. This means that you can, for example, write a button's `onclick` that issues a (strong-typed) RPC call to the backend all in Ur. Sort of like tRPC for TypeScript.

You can find all of these features in other web stacks, as mentioned. But in Ur/Web everything is tightly integrated. And you can also be sure of your app's correctness due to all the static and type checks.

Those are the good parts. The bad part is that Ur/Web went down the ML rabbit-hole. You pretty much have to be familiar with an ML language to be able to use it. It also suffers from the usual low adoption of ML languages.


What’s wrong with “going down the ML rabbit hole”?


It is a very tough business case to make, and as mentioned, you can have similar functionality in Typescript. So rather than switching to an obscure stack, why not use somewhat less obscure tools like tRPC?


Not every project is commercial.


Pehaps, but this particular project is very much about solving the usual business cases. For recreational programming, I'd look elsewhere.


I was preparing myself to be surprised to discover this was a programming language using Akkadian, complete with cuneiform script.

This, however, was not it!

That said, people are already using this language for their projects -- even commercial ones: http://impredicative.com/ur/users.html


I stumbled across it, because bazqux.com (which I‘m trialling now) uses it:

    Is BazQux Reader re­ally writ­ten in Haskell and Ur/Web?
    Yes. I love to use the best tools avail­able.


I am now also trialing bazqux. It is not bad. Is this the power of the best tools available?


In all seriousness, this is probably the best RSS reader I have used recently. It's, so much faster than what I was using that I had to redo all my estimates for how long it should take to do stuff with an RSS reader.

I had to get a stopwatch and start clocking how long it takes me to do things using a computer recently, because I swear like half the software I was using was slow for no reason despite buying super fast ssd/ddr18 ram/cpu etc. I got rid of all my games I could not launch from the desktop and be playing the game within 30 seconds, and my entire outlook on gaming felt better. I really hate when software wastes your time.


I've learned that if there's a language, there's someone using it commercially :)


I thought this would be about the First Programming Language that nobody remembered, the ur-heimat incubator of some obscure syntax that became everything from FORTRAN to Ruby


Yes, I was definitely expecting cuneiform and base 60 literals.


I want this now. Bonus points if it's a vector language and is as terse as K.


I love this, and would love to work professionally in languages like this.

I saw that last release was in 2020, and took myself in an acquired reaction on the "staleness" of this project.

The thing is just, that projects like these become stable at a point and need no more upgrades – from there it is horisontal features that can happen in libraries.

This is a stark contrast to the Typescript/React ecosystem I am spending my time mostly on these days. Every time something does not work as expected, it is probably beucase some package was updated underneath your feet.


Elm claims the same thing as justification for its lack of updates

https://iselmdead.info/

But that usually doesn't go over very well


Except Evan and his wife are developing elm for backend and elm.studio


People love the “BDFL” model. This is what they deserve.


Yeah, sometimes it blows my mind just how much time I have to spend dealing with updates to dependent (or meta-dependent) packages because our project, or one we integrate with, used some popular framework or library. With modern web stuff, even supposedly-non-breaking changes sometimes introduce bugs or change behaviour in subtle ways that cause issues.


Related. Others?

The Ur Programming Language Family - https://news.ycombinator.com/item?id=10169244 - Sept 2015 (18 comments)

Ur/Web, a Simple and Powerful Language for Secure Web Applications - https://news.ycombinator.com/item?id=8793272 - Dec 2014 (1 comment)

Ur/web: pure functional, statically typed web programming - https://news.ycombinator.com/item?id=7829100 - June 2014 (45 comments)

Ur/Web in production - https://news.ycombinator.com/item?id=7072437 - Jan 2014 (1 comment)

A Google Reader Replacement written in Haskell and Ur - https://news.ycombinator.com/item?id=5961570 - June 2013 (46 comments)

The UR Programming Language - https://news.ycombinator.com/item?id=1757199 - Oct 2010 (1 comment)

The Ur Programming Language Family - https://news.ycombinator.com/item?id=1412503 - June 2010 (11 comments)

Ur/Web: The Ur Programming Language Family - https://news.ycombinator.com/item?id=810726 - Sept 2009 (1 comment)


Urweb is extremely cool. My own attempt to use it for personal projects was shut down by how isolated the server component is; I think I was trying to read a json file on the server from within urweb and there just was not a way to do it without using the C FFI. Even BazQux reader had some workaround that just read in a stream of bytes which seemed to side step the security model entirely.


Adam Chlipala is behind this and his formal methods books are outstanding.

In particular, FRAP is really great: http://adam.chlipala.net/frap


Hello, designer of Ur/Web here. It's great to see it popping up again on HN! Apologies for the diminishment of visible activity in the last few years. I've been distracted by working on our Ur/Web-based startup Nectry (https://nectry.com/) in parallel to my professor job.

We hope to be able to hire more engineers to do Ur/Web development at Nectry in the foreseeable future, so do let me know if you think you might be a good match.


Advanced programming languages with state-of-the-art compilers are a great fit for implementing low-code tools, aren't they? I'm surprised I haven't seen anyone doing that with Haskell yet.

On a similar vein, I imagine the folks at Hasura might be doing some pretty advanced stuff to convert arbitrary GraphQL queries into efficient SQL statements.


Tailcall is building something similar in that regard. The idea is to allow developers to specify their orchestration requirements using a DSL and then behind the scenes generate an ultra high performance backend for GraphQL. The query could span over REST, GRPC and other GraphQL services. Check it out — https://github.com/tailcallhq/tailcall


Lately, esoteric realms of computing have started trending on HN every day - lazy evaluator languages and concatenative languages and array languages and research operating systems and standards that are no longer in use or died as a proposal.

It's been quite a few years since this was a daily feature so I assume something happened. Maybe layoffs.


Whatever it is, a change of the usual “AI”/“GPT”/“LLM” barrage we’ve had for the last months is welcome!

I miss coming to HN and seeing cool things that I wasn’t aware of!


I don't know, but for me that's the second best feature of HN; learning about the edge of the digital universe.

The best feature is, of course, discussing these things with the very people who made them.

Such a cool place!


The whole startup ecosystem that normally trends on here is substantially less interesting than it used to be now that interest rates are above zero (and the section 174 tax changes are definitely not helping). Layoffs are another symptom of the same root cause—in the absence of a thriving startup ecosystem neat tech can surface to the top again, not because people have more free time after layoffs, but because there's not much else to talk about.


My first instinct when people start talking about cool tech is also to ask if they are unemployed.


I've used Ur/Web for an old project (https://github.com/steinuil/negoto). It's a very cool language with a lot of great ideas, and once you get going it really makes it easy to set up a server that interacts with a DB and dynamic frontend features.

The compiler, and its error messages, are somewhat inscrutable if you don't fully understand some of the more advanced features of the language, and some stuff I felt I was honestly not smart enough to figure out after a while. There was a point for me where most of it clicked together, but it took a long while to get there.

Ultimately what made me stop using it after that project was the features of the server itself. You can compile it to a self-contained HTTP server, but some issues that I don't remember right now made it unfit to use outside of development, so you're left with CGI and FastCGI. Like another comment mentioned, there's some stuff you can only do using the C/JS FFI, and Ur/Web's transactional nature sometimes makes it hard to tie these additions into the rest of the language. There's also some things (such as submitting a form with multiple files, IIRC) that are not supported by the compiler, and even after submitting a patch to fix some issues with the SQLite backend I didn't feel comfortable enough with the big pile of terse SML to patch those in.


This has some interesting ideas because it might help us get us from the current entangled mess we call web development.

I'm not sure embedding xml in code is the way, templating does have nice things, but most certainly some kind of declarative syntax for markup mixed in with data.

We've learnt over the last few years that the functional style of hydrating down views, e.g. SwiftUI is definitely a nice to have to compose large structures (without exaggerating though, I'm looking at you React/GraphQL), but passing data around is still a big PIA.

Reasoning about data in a high level language such as Eloquent/LINQ is nice (minus the abstraction leaks), but it bears reminding that most pages are views on a SQL request. Maybe we should start there. Maybe the webpage is a query.

I honestly think we need to ditch javascript and have a native language of the new web, with a sensible compiler and accessibility built in.

At the rate of the internet going the way it is going at the moment, maybe we will get to a grassroot soft-reset of the net in the coming years. Sadly, Gemini is not it, although it has its merits.

Not a fan of the haskell approach to the world though. It works in a vacuum, not in the real, dirty, world.


Looks like a statically typed PHP replacement with a lot of domain-specific type checks. I really wanted to see how they enforce this one: ‘Include client-side code that makes incorrect assumptions about the "AJAX"-style services that the remote web server provides’, but couldn’t find any examples on GitHub.


It's part of the ML family, so it looks more like Elm (or OCaml, or Haskell, etc.) than PHP.

If my memory serves, the way they enforce this is by generating the client alongside the server.


I think he means PHP in the sense that you're inlining code with markup like in PHP (i.e: a templating engine)


Makes sense.


Also see Wadler’s Links and OCaml/Ocsigen for inline xml fragments, and client + server code generation


It's amusing that a language called "Ur" is built on antecedent languages.


Ur the city was also built on antecedent cities and cultures. And what programming language isn't built on an antecedent language?


There's the city of Ur, but there is also the prefix ur-, meaning primitive or original.

What programming language isn't built on an antecedent language? Why, the ur-language, of course! Arguably, this is FORTRAN.


I was curious so looked it up. FORTRAN had a predecessor: https://en.wikipedia.org/wiki/Speedcoding.


which itself was influenced by some sort of assembly language and even machine code


I immediately thought of Hoon, Nock for the Urbit world.


Same here. Which inevitably leads me to revisit the question “Does this make enough sense to me that I want to dig into it right now?”. The answer is always no. But I’m going to go look again right now.


Urbit now has a lower entry barrier with comets than when it first came out I believe. I am going to look into Ur. I remember reading Nock/Hoon snippets when it was relatively new, but I was lost in the whole Urbit thing at the time. Ur looks interesting as a PL, however, I am currently dating Uiua after my break up with APL/BQN. J is still a side hustle.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: