We also have an integration for ReScript https://thin.dev/docs/rescript
More to follow in the future
1,262 karma · joined March 7, 2014
https://www.digitallyinduced.com/
marc a t digitallyinduced com
We also have an integration for ReScript https://thin.dev/docs/rescript
More to follow in the future
Our pricing still might change a bit in the future. I'm with you that with a couple hundred users it shouldn't cost more than 5-10$ to host this app.
The Thin Pro plan already includes 5GB for free, so we might increase these 5GB to a bit more.
In some ways Thin is designed a bit more opinionated. This allows us to e.g. support optimistic updates out of the box.
Supabase generally also exposes very low level APIs (basically just a REST Api via PostgREST), where we offer very high level APIs that sent over a WebSocket.
Thin can quickly be integrated in an existing stack as long as you're using postgres.
The value proposition with an existing backend can be: Improved UX thanks to very low latency. E.g. Thin automatically does optimistic updates when you're inserting or updating a database record. This results in a really nice user experience compared to what you'd get with a normal REST Backend.
I've no experience with blitz.js. From a first look it seems it goes in the same direction. Blitz.js is not leaning on realtime as much as we're doing. Additionally it seems that it doesn't provide optimistic updates out of the box.
On IHP: Yes! :) IHP has a promising future ahead! All the Thin Feature are btw also supported in IHP. The Thin JS library is just a small wrapper around the IHP DataSync SDK :)
Created an issue for that interally. We'll fix this soon!
Thin is a version of the IHP Framework (https://ihp.digitallyinduced.com/), designed to be used by frontend developers. Instead of building APIs with low-level `fetch` calls, we provide high-level APIs like `createRecord('tasks', { title: 'Hello World' }`, `updateRecord(..)` and `deleteRecord(..)` to update your database.
To simplify state management (which is typically hard and lot's of boilerplate), we provide realtime APIs so that all app state is always in sync with the actual database. Previously your react app might have been rendered from the redux state, now it's rendered directly from the server state.
The Schema Designer and the migration tools make it really easy to get going with a project.
Internally Thin is built with Haskell and powered by IHP DataSync (https://ihp.digitallyinduced.com/Guide/realtime-spas.html).
Happy to hear everyone's feedback! :)
The Haskell ecosystem has improved quite a lot in recent years: E.g. there's now Haskell Language Server which provides very nice autocompletion in Editors like VSCode. Very recently support for dot-notation has been added, so you can now write `someValue.someField` as in other languages. In the web dev space we now have IHP, which is Haskell's take of Laravel/Rails/Django https://ihp.digitallyinduced.com/ (Disclaimer: I'm founder of the company that makes IHP)
So if you have checked out Haskell in the past already, you might want to give it another try! :)
post <- fetch postId
>>= fetchRelated #comments
This is fine for simple form based CRUD apps.As you mentioned you're consuming the data with a JS frontend: For these cases we added a subsystem called DataSync to IHP. DataSync allows to use the IHP query builder directly from the JS side. This way we basically avoid needing to hand-write these nested graph API responses. Complex forms that depend on a lot of complex data can now be implemented using React components.
Here's an example query call from the JS:
const todos = await query('todos')
.where('id', 'd94173ec-1d91-421e-8fdc-20a3161b7802')
.or(where('id', '173ecd94-911d-1e42-dc8f-1b780320a316'))
.fetch()
This way the frontend can query data that it needs just in time. And also write records to the database without needing to manually writing API actions (thus avoid the data tree problem).You can find an example of this here: https://ihp.digitallyinduced.com/Guide/realtime-spas.html#bu... For web apps that are fully consumed by a single page app, we're right now building IHP Backend, which provides the IHP tooling + the DataSync API in a way that is way simpler than full stack IHP. If you're curious, you can find a demo video here: https://youtu.be/-jj19fpkd2c
If you're interested in Haskell and are doing web dev, check out IHP, Haskell's version of Laravel/Rails/Django: https://ihp.digitallyinduced.com/ (Disclaimer: I'm founder of the company that makes IHP)
https://github.com/digitallyinduced/ihp/blob/master/ProjectG...
The actual IHP project has it's own nix-shell environment, so that all project dependencies are managed locally (https://github.com/digitallyinduced/ihp-boilerplate/blob/mas...).
You can find a couple real-world examples here https://ihp.digitallyinduced.com/Guide/examples.html
The IHP docs assume no knowledge about nix, so it should still mostly be very simple to get started.
We compiled a couple more reasons why IHP uses nix in this blog post: https://ihp.digitallyinduced.com/blog/2020-07-22-why-ihp-is-...
Btw: To give IHP a try without installing Nix you can also try out the official GitPod image here https://gitpod.io/#https://github.com/gitpod-io/template-ihp :)
Automatic migration generation has only been added in the last release a few weeks ago. Right now it works by keeping track of all changes you apply via the GUI based schema designer, and then writing that into the migration sql file once you generate a new migration.
When you add a trigger manually to the Schema.sql file of your app, you then still need to copy it over to the migration manually right now.
We're still exploring that auto migration space. In the future we might switch to a real schema diff approach (in fact there's a WIP PR here https://github.com/digitallyinduced/ihp/pull/1137)
> Second question- Is there something I could read to catch up with what's happened to the Haskell language over the last 5-10 years or so, since I looked at it last?
I'm not aware about a central place for this. The closest might be the GHC change log, but that also contains a lot of noise.
In a comparison between IHP and Yesod I think that IHP is designed for people that have only very little to no haskell experience. IHP brings a lot of conventions and code generators to get you up and running very quickly, while Yesod gives you more flexibility (flexibility might be more challenging when you're just starting out with haskell. E.g. what DB library do you want to pick? In Yesod you have many options, in IHP we'll provide one out of the box). Check out the IHP documentation and compare it to the Yesod docs, you'll quickly see the difference :) Also if you want to check out some reviews of people already using IHP, you can find a few longer ones on our G2 page https://www.g2.com/products/ihp/reviews
> Can I create rest and especially graphql apis or is it more focused on building old-school server side rendered pages?
At the start IHP was focussed a lot on server-side rendering. Now you can also use it for building REST APIs. GraphQL is not yet supported, but it's coming in the future.
We're also right now working on a generic REST API layer with a bundled JS SDK. It will allow you to query your database, create and delete models and keep everything in sync with a realtime sync engine.
Here's a JS code example:
const tasks = await query('tasks')
.orderBy('createdAt')
.fetch()
On the backend we use Postgres Row-level-security Policies to make sure that a user can only access his own data.Here's a demo react component that uses the new JS APIs: https://github.com/digitallyinduced/ihp-datasync-demo/blob/m...
Docs are still in progress, but here's a draft https://github.com/digitallyinduced/ihp/commit/39baa4aa23cc6... :)
If you're curious about giving it a try and are doing web dev, check out IHP, haskell's largest web framework: https://ihp.digitallyinduced.com/ (Disclaimer: I'm founder of the company that makes IHP)
Avi gave me a demo last week as we’ve been looking on how to get better analytics for our open source framework IHP https://ihp.digitallyinduced.com/ it’s quick to set up and they also provides tools for doing analytics for eg the documentation.
1. Complexity caused by the change of paradigm: This specifically hits programmers with a lot of experience in OOP languages. For getting into the FP-mindset your brain needs a bit of time to get rewired. You need to switch thinking about mutating objects to thinking in mapping streams of data. Given that many OOP languages are adopting functional ideas like map and fold/reduce, nowadays a lot of developers already have a bit of experience in thinking in the FP-way, and this will get better with time.
2. Complexity caused by the tools: There's a reason the author in the above post started out with Elm instead of Haskell :-) Writing a few recursive functions in haskell is still pretty simple. Where it get's very complex is when you want to build real world applications. To build a simple web app you need to 10s of decision on what tools and libraries to use. Here's a couple questions you'll need to find an answer to when building a haskell app:
- What GHC and what language extensions do I need? How do I install it? - What package manager do I use? Cabal, nix, stack? - What web server library? - What database library do I need? Do I need an ORM, are there even ORMs in haskell even though there are no objects? - What HTML template library to use? - How do I compose it all together? What is a monad stack?
When you have only very few experience in haskell it's really hard to not get stuck here. The quality of documentation of most haskell tools also doesn't very much help here.
I believe that the value haskell can bring is signifcant, and by fixing the tooling situation we can a lot more people to adopt haskell in the future.
With IHP we're trying to fix the tooling situation and build a haskell-based web framework that is as easy to use a rails or laravel :) To combine the benefits of purely-functional programming with the RAD approach of rails, laravel and django. It's now already the most active haskell web framework and we have many people starting their haskell journey with IHP.
We have live reloading in dev mode, a JSX-inspired template language and many code generators to quickly get started with shipping real world apps.
Check out this video of building a simple blog app in IHP: https://www.youtube.com/watch?v=UbDtS_mUMpI To get started (supports macOS, linux, windows) check out the IHP Website: https://ihp.digitallyinduced.com/