mike1o1

Joined 12 years ago

Karma
1,641
Submissions
144
Member since
Mar 19
Senior dev, interested in React, React Native and Elixir.

I blog (very infrequently) at https://www.mikewilson.dev if you want to get a hold of me!

View on Hacker News

Recent submissions

Comment · 4 months ago
Comment · 4 months ago
Comment · 11 months ago
https://github.com/historicalsource/zork1 Direct link to the repository
Comment · 1 year ago
I have some projects with a fairly steady load that I'm currently running on a VPS on Digital Ocean. I have some non-critical ones that I'd be interested in moving to "bare metal" for learning purposes, but having a hard time figuring out what the transition from VPS to dedicated server would look like.

Anybody have any guides or guidance on making the migration? I feel comfortable managing the VPS, but not sure what else I'd need to take on by moving to a dedicated server. I imagine hardware monitoring would be one, but what else?

Comment · 1 year ago
Comment · 1 year ago
Comment · 1 year ago
A bit late but it’s been fantastic so far. I’m using it for a GraphQL backend so I haven’t tried with LiveView yet but I don’t think it’ll differ too much. I know Ash has their own changesets which might be a bit different, but can’t say for sure. In general Ash has a rough learning curve, but it helps a LOT for what I think Phoenix is missing or isn’t opinionated about which is the context layer. Ash basically builds that for you, and probably better and more secure than you can do yourself. The way I see it, a LiveView to display data might do something like MyContext.fetch_items(scope: socket.assigns.scope). All Ash does is derive those functions for you. So maybe you have MyDomain.fetch_items(actor: socket.assigns.user) But then if you want filtering, sorting, etc that’s all there for you, while you’d have to build that yourself with Ecto. But then did you remember to filter your joins to only retrieve the items the user is authorized to see? Sure, you can do that in Ecto, but it’s kinda just built in with Ash policies. I hope that helps - Ash doesn’t replace anything that Phoenix or LiveView offer (except maybe changesets are slightly different), it very much builds on top of it.

Edit to add, Ash is built on top of Ecto. The escape hatches are there, and easily accessed if needed. Ash.Query is very powerful and I haven’t needed any escape hatches on a small to medium sized project so far.

Comment · 1 year ago
Comment · 1 year ago
I use Tidewave which is a package for my Elixir app, and it allows the LLM to get access to some internals of my app. For example, Tidewave exposes tools to inspect the database schema, internal hex documentation for packages, introspection to see what functions are available on a module, etc.

While I’m not “vibe” coding, it is nice to be able to ask human language questions and have the LLM query the database to answer questions. Or while working on a feature, I can ask it to delete all the test records I created, etc. I can do that in a repl myself, but it’s sometimes a nice shortcut.

Note, this only runs in dev, so it’s not querying my production database or anything.

Basically, they can be a way to expose additional data or tools to the LLM.

Comment · 1 year ago
I guess, but you'll be writing a _lot_ of code yourself, that might be hard to maintain and can become brittle overtime as requirements evolve.

As an example, I wanted to add support for adding tags to a resource, and support filtering for the resource by the tag, and I wanted to be able to do this filtering both through Elixir functions as well as GraphQL.

Can I do this with Ecto? Absolutely, but I'd have to build it all myself.

With Ash, I created a `Tag` and `Tagging` resource, adding a `many_to_many` block on my resource, marked it as public. Then I added the `AshGraphql.Resource` extension to my `Tag` resource, marked it as filterable and I was done.

Now I can filter and sort by tags, filter by where tags _don't_ exist and more. I didn't have to do anything other than model my domain, and Ash took care of the rest for me. Not only that, but it probably did a lot of things for me that I probably wouldn't have thought of, such as supporting multi-tenancy, policies and more.

It really is a lovely tool, I can't say enough good things about it.

Does it have a learning curve? Absolutely! Is it worth overcoming it? Again, absolutely!

Comment · 1 year ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton