Readit News logoReadit News
m8s commented on Parrot – type-safe SQL in Gleam, supports SQlite, PostgreSQL and MySQL   github.com/daniellionel01... · Posted by u/TheWiggles
jsight · 3 months ago
So, basically sqlc for Gleam? Sounds nice.

I wonder how Gleam compares to the type checking support being added to Elixir?

m8s · 3 months ago
The two feel very different. Elixir is introducing gradual set-theoretic typing (https://hexdocs.pm/elixir/1.18.4/gradual-set-theoretic-types...) while Gleam has a static Hindley-Milner style type system.

To me, Gleam feels like if Elm’s type system met Rust’s syntax. I really like it. But I also really liked Elixir too, I just can’t live without Gleam’s type system anymore.

m8s commented on I spent five years building a webapp and got my first $1 (2022)   codingcafe.jp/posts/signa... · Posted by u/sillysaurusx
android521 · a year ago
Spent last year working on a side project and assumed I would need this and that in order to launch. But after it was ready to launch, I found out there was no product market fit. I have known about the importance of quickly finding out pmf but still made the mistakes. knowing != doing. We just love building stuff and mistakenly convince ourselves that if I add one more feature, this thing would be ready for launch and take off. But in reality...
m8s · a year ago
It’s a good lesson. We found PMF with a shared google sheet and a bit of data processing behind the scenes. The level of polish I’d come to expect as an engineer at an enterprise company was astronomically higher than what was actually needed for our customers to give us their dollars.
m8s commented on Governor Newsom signs bill to protect kids from social media addiction   gov.ca.gov/2024/09/20/gov... · Posted by u/Cyclone_
m8s · a year ago
This is a really gross comment and should be removed.
m8s commented on "Frost crack" sounds may come from sky, not trees   nautil.us/how-the-night-s... · Posted by u/jnord
Willingham · a year ago
In grade school I read a book called ‘The Hatchet’. It was a story about a man who survived a plane crash near the arctic circle and had survived many days on his own with not much more than a hatchet. He experienced these sounds after a number days in the harsh wilderness and thought it was gun shots and that he was going to be saved. The book then went on to explain that it was the trees cracking from the extreme cold. I was mesmerized by this as a kid. Knowing now the true origin of the ‘frost crack’, I’m twice as captivated.
m8s · a year ago
That reminds me, there’s a really great survival game called The Long Dark in which you survive a plane crash in something like the arctic circle and must survive. If anyone is into survival games, definitely check this one out!
m8s commented on Enhancing Your Elixir Codebase with Gleam   blog.appsignal.com/2024/0... · Posted by u/crowdhailer
k__ · a year ago
Isn't use part of Elixir?

At least I saw it in Elixir in Action, use GenServer or something...

m8s · a year ago
m8s commented on Enhancing Your Elixir Codebase with Gleam   blog.appsignal.com/2024/0... · Posted by u/crowdhailer
behnamoh · a year ago
Gleam is beautifully designed, but I don't really understand the concept of "use". I've read every article and documentation I could see about it, but it still doesn't "click". Perhaps using another keyword (instead of "use") would work better?

In general, I find "use" a big deviation from Gleam's philosophy. Everything else in the language is well-defined and serves a specific purpose. "use", however, serves several goals, and thus is ambiguous (in the sense that it doesn't have one well-defined definition). [0, 1]

[0]: https://www.reddit.com/r/ProgrammingLanguages/comments/19ctw...

[1]: https://erikarow.land/notes/using-use-gleam

m8s · a year ago
Erika wrote “Using use in Gleam” in part because I didn’t understand how to use `use`, so I feel at least a little bit qualified to answer this.

I find that `use` is quite effective when needed. This is the part referenced in her article where I find `use` particularly helpful. Something like:

    fn outer() -> Result(success, failure) {
      result.map(parse_id(), fn(id) {
        ... // More code that uses the id
      })
    }
Becomes:

    fn outer() -> Result(success, failure) {
      use id <- result.map(parse_id())
      ... // More code that uses the id
    }
In more concrete terms, I’m building an application with Gleam and Wisp that uses Wisp’s `require_form`. The type signature for `require_form` is:

    pub fn require_form(
      request: Request(Connection),
      next: fn(FormData) -> Response(Body),
    ) -> Response(Body)
But I get to use it like this:

    use form <- wisp.require_form(req)
I’m not sure if I have the appropriate nomenclature here, and I consider myself a beginner of writing strongly typed functional languages, but when I use `use`, I get to invoke the callback with the value on the left side of the arrow.

As Erika so thoughtfully put it:

> The key is to use `use` when it allows you to highlight the happy path of your code … A use expression is syntax sugar, and it’s always possible to write Gleam code without it, though maybe not as clearly.

You can see more here [1] if you want, but note that there are a lot of structural changes in this codebase while I learn and figure out how to best use Gleam and Wisp :)

1. https://github.com/usepriceflow/app/blob/main/src/app/web/ad...

m8s commented on The Guide to Gleam Concurrency [video]   youtube.com/watch?v=8rCgn... · Posted by u/crowdhailer
m8s · 2 years ago
Awesome video, and definitely captures some of the super powers of targeting the BEAM! Thanks for sharing
m8s commented on Gleam v1.0.0 Released   gleam.run/news/gleam-vers... · Posted by u/lpil
m8s · 2 years ago
Congrats to the community, Gleam is a really awesome language! This is such exciting news!
m8s commented on Building ColdFusion for the Web   thehistoryoftheweb.com/bu... · Posted by u/paulgb
m8s · 2 years ago
Hands up if you’ve still got ColdFusion powering critical apps in production to this day
m8s commented on Ask HN: Is React Native still popular?    · Posted by u/haliskerbas
hn_throwaway_99 · 2 years ago
> I think React Native is fantastic for getting out basic applications that may need camera, map, browser, and storage, etc capabilities

The thing is, though, browser-based APIs let you do all of that now, in a way that is usually a lot simpler to access. In these cases it's often a lot easier to just build a Progressive Web App for Android (Google let's you put PWAs directly in the Play Store), and wrap that with a thin native wrapper for iOS.

One of the big "aha" moments I had was a couple years ago when I was trying out Stripe's Identity product, which lets you take a selfie and a picture of your ID for identity verification purposes. It's pretty amazing how Stripe was able to do the full image analysis (i.e. edge detection when you take a picture of your ID) solely with browser APIs.

With the big exception of games, there are a vanishingly small number of apps that really require native functionality these days, given what you can do in the browser.

m8s · 2 years ago
It doesn’t really matter what can be done natively versus in a browser. For many folks, apps are the internet. This take is very developer-centric but it doesn’t account for the real world. Many people prefer using apps, especially middle-age to older demographics. That’s what our analytics say at least.

u/m8s

KarmaCake day506December 3, 2020View Original