HNHacker News
TopNewBestAskShowJobs

globuous

1,340 karma · joined June 14, 2014

submissionscomments
globuous··on OCaml as my primary language
What I missed most were let bindings (https://ocaml.org/manual/5.3/bindingops.html)

ReasonML has custom operators that allows for manipulating monads somewhat sanely (>>= operators and whatnot). rescript (reasonml’s “fork”) did not last time I checked. But it does have an async/await syntax which helps a lot with async code. reasonml did not last time I checked, so you had to use raw promises.

I believe Melange (which the article briefly talks about) supports let bindings with the reason syntax.

And this kinda changes everything if you React. Because you can now have sane JSX with let bindings. Which you could not until melange. Indeed, you can PPX your way out of it in ocaml syntax, but I’m not sure the syntax highlight works well in code editors. It did not on mine anyway last time I checked.

So for frontend coding, Melange’s reason ml is great as you have both, and let bindings can approximate quite well async syntax on top of writing readable monadic code.

For backend code, as a pythonista, I hate curlies. and I do like parenthesis-less function calls and definitions a lot. But I still have a lot of trouble, as a beginner ocamler, with non-variable function argument as I need to do “weird” parenthesis stuff.

Hope this “helps”!

globuous··on John Carmack and John Romero reunited to talk DOOM on its 30th Anniversary
Looks very interesting, thanks for sharing! The pricing section is very informative btw, congrats to the author for sharing it
globuous··on USB inventor explains why the connector was not designed to be reversible (2019)
No way! I didn't know that was part of the standard! Very useful "trick" indeed, unless of course, the USB port is placed vertically...
globuous··on Ollama for Linux – Run LLMs on Linux with GPU Acceleration
AMD support would be amazing <3

I get the boot concern, and the maintenance concern (!!!), but as you say, these models are already quite huge anyway :)

globuous··on Compiling Functional Languages (2002) [pdf]
Interestingly, the last slide mentions:

``` Today: we are able to certify realistic bytecode compilers and abstract machines.

Tomorrow: certification of optimizing native-code compilers? ```

Xavier Leroy actually got the ACM Software System Award in 2021 for CompCert, an optimizing native-code compiler! It's first version seems to have been released in 2005, just 3 years after this presentation was written. Though CompCert is a C compiler, which isn't really a functional language.

- https://en.wikipedia.org/wiki/ACM_Software_System_Award - https://en.wikipedia.org/wiki/CompCert

globuous··on Kubernetes Exposed: One YAML Away from Disaster
Is that not what you’d do? That sounds like an unusually useful review tbh.
globuous··on One can scarcely help clarifying him: on the Brothers Karamazov
If you liked war and peace, you should check out grossman’s life and fate, it’s WWII’s version, fantastic. And blacklisted by the soviet government because critical of it.
globuous··on Inconvenient Truths about TypeScript
That's true, and I was impressed first time someone showed me that. But the cost of this luxury might not be worth it. Indeed, you mostly (only ?) communicate through an API. And if it's properly documented, which is now essentially automatic, you can easily generate your types from the frontend. To me, the cost of bringing JS to the backend dominates this luxury to the point where it's just not worth it. I'll just generate my types from the frontend and be done with it.
globuous··on Functional Programming with TypeScript's Type System
Yeah, there are some weird stuff in typescript, for instance, this typechecks

    class Animal {}

    class Dog extends Animal {
        woof() {}
    }

    class Cat extends Animal {
        meow() {}
    }

    let append_animals = (animals: Animal[], animal: Animal) => animals.push(animal)

    let dogs = [new Dog()]
    append_animals(dogs, new Cat())

    dogs.map(dog => dog.woof())

Which if you evaluate, you'll obviously get:

    Uncaught TypeError: dog.woof is not a function
Whereas Mypy won't typecheck the equivalent Python code:

    class Animal:
        pass

    class Dog(Animal):
        pass


    def append_animals(animals: List[Animal], animal: Animal) -> None:
        animals.append(animal)


    dogs = [Dog()]
    append_animals(dogs, Dog())

It'll throw with:

    $ mypy types.py 
    types.py:16: error: Argument 1 to "append_animals" has incompatible type "List[Dog]"; expected "List[Animal]"
    types.py:16: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
    types.py:16: note: Consider using "Sequence" instead, which is covariant
globuous··on Deck.of.cards
It looks like the randomness is generated at shuffle time and then maintained. You can check by hitting « fan » and then « flip » multiple times. It always returns the same card order between shuffles which seems to imply that it’s maintained.
globuous··on Ask HN: Tools to learn music theory?
A great tool is, believe it or not, Ocaml/Rescript!!

I was tired not remembering how to name intervals, construct chords, my arpeggios and scales and what not. So I coded it to help me figure all of that out. I also wanted a frontend to visualize all of this because notes on the guitar are all mixed up and it's hard to reason about when you have a terrible memory like I do:

- Theory.res: https://github.com/tbinetruy/solfeggio-calculator/blob/maste... - Frontend: https://tbinetruy.github.io/solfeggio-calculator/

I also have some notes on that repo that have helped me a lot where I can summarize my findings. But this exercise has been enlightening. Both from the coding and musical perspectives. Because Ocaml really forces you to model music and thus ensure that you understand the concepts which helps you remember them.

I can finally start soloing over chord progressions using arpeggios now! It's essentially comes down to playing a scale in thirds starting on the chord root note on chord changes! And I can finally understand my fretboard without having to look at my frontend's chord diagrams anymore. I still don't know the notes, but I understand their relations with each other.

I've also started learning jazz because it's a lot more theory based than pop/rock since you have a lot more exotic chords and solos are guided by the underlying progression. I really like Jens Larsen's YT channel. It's very hard to get into at first because he goes quite fast, but has some very accessible videos such as this one: https://www.youtube.com/watch?v=7q2LB45ts0M.

Hope this helps :)

globuous··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Niiiice ! So we should also be able to unit test ou components in pytest and debug them with PDB ? Gonna check this out real soon :)

As a react dev turned django dev, I cannot wait to get my hands on this!

Edit: how come the counter example is so slow on my iPhone 11 though ? That seems real weird https://pynecone.io/docs/getting-started/introduction

globuous··on Sex, food or water? How mice decide
I recall reading a funny article, by some guys at cornell if my memory does not fail me, that concluded that obesity rates were lower in europe because europeans would stop eating when they weren't hungry anymore. Whereas americans would stop eating when turning off the TV (and therefore would continue eating after being full).
globuous··on Show HN: Get advice from a GPT3-based stoic philosopher
wow, this is cool, quotes are sourced! :)
globuous··on Leonardo da Vinci’s experiments explored gravity as a form of acceleration
Which was in itself the genius of this newton guy. It’s one thing to realise that objects falling accelerate. It’s another to realise that F=ma, and that this can model objects falling as well as a bunch of other things. Surely da Vinci wasn’t lucky enough to have an apple fall on his head ? :)
globuous··on Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
Unfortunately, you cannot install timescale on an rds, or I believe , other managed Postgres services : https://stackoverflow.com/a/67712962.
globuous··on Using GPT3 to Interpret Dreams
I used your message as input to this website, and that's what I got :joy:

Your dream reflects your inner desire to find a way to use GPT3 in a way that is both convincing and meaningful.

You feel that there is a gap in the industry for something that is about convincing people with words, rather than being focused on what is right and wrong. You are looking for a place where you can use GPT3 to your advantage, but also be aware of its weaknesses and limitations. You feel that GPT3 could be a great asset to any industry, if it is used correctly and with an awareness of the potential pitfalls. You are looking for a way to apply GPT3 that is both convincing and meaningful, and that will not have significant repercussions if it is applied incorrectly.

globuous··on Show HN: A web front end for your Org-files
Ah ! Interesting ! I haven’t had the time to look, but is the org parser re written in ocaml or does is use emacs ? I’m wondering because I once had so many todos in so many files that it would cripple my org todos when I opened them. I actually rewrote a small Qt/Cpp frontend for my orgmode needs before giving up.
globuous··on DontBuyDell.com
I've got a small XPS, it's just horrible. Mine's 11 months old, my "j" key is already coming off (thanks vim !), the speakers are so small my iphone's louder, the battery life is terrible and I've already had fan problems. It's just a awful awful piece of hardware.

Too bad because the size is great !

globuous··on Tell HN: Apple products come with ungrounded plug in India
If you buy them in France, I believe they do come with 3 pin chargers. They used to anyway.

But yeah, their aluminium body used to sock me every so often with their 2 pin chargers in the us. Was always kinda surprised they never sold 3 pin chargers like in any other developped county !

globuous··on An accentuated Emacs experiment (à la macOS)
True that. But I typed French on a qwerty for a while on Mac OS, and you « just » alt+e-e to do é or something. You get used to it.

And on iPhones, I never actually hold « e » to show the accents, their system figures out the accents. Although it missed sometimes, it’s pretty good. I can just type « je suis arrivee a la maison » and it accentuâtes my letters properly. Actually, I had to manually remove the accents for this exemple ^^

Édit: ok, that’s kinda funny, it must be because I typed French in English and it messed it up, but « accentuâtes » doesn’t make any sense, same with « édit » it just inferred for my. Leaving the message as is for the lols

globuous··on Minerva: Solving Quantitative Reasoning Problems with Language Models
That’s the topic of my thesis ! Here’s some work by open ai doing exactly that ! :) https://arxiv.org/abs/2202.01344
globuous··on Introducing PyScript (summary of PyCon keynote)
I want to love async. But it’s a nightmare to debug. To this day I still cannot debug tortoise ORM. I dont understand why I can await so easily in my browsers JS console but not in pdb.
globuous··on Introduction to Compilers and Language Design (2021)
Agreed! I would have used ML faminly languages. Of course, that implies learning ML before reading the book whereas C is definitely known by more developers as it’s been in all of our courses
globuous··on Playing with DALL-E 2
This is just insane.

The image to the prompt "A dog looking curiously in the mirror, in digital style" shows a cat looking into a mirror and seeing a dog as itself! Although very creative and "objectively funny" (may cat is like a dog!!!), I think the AI understood "A dog looking curiously (is) in the mirror".

These poems are absolutely hilarious also, it's photo-realistic, but the messages make no sense, though the fonts look so perfect! That's where you know it's clearly AI generated ^^ For now.... Sometime soon it looks like realistic pictures of protests are going to be so easy to generate with arbitrary text

globuous··on iFixit and Google Are Launching a Genuine Pixel Parts Program
I bought a pixel 4a last year, six months later, it stopped reading my sim. Got it replaced, but had to mail it to Google and was out of a phone for 10 days...
globuous··on Algebraic Data Types in Haskell
True that! It was eye opening once I understood that! Here's a basic type system I made in Python for a small smart contract language compiler I'm working on. It works with mypy pretty flawlessly! [1] I still haven't figured out how to prevent subclassing with methods that don't comply with a specific type signature, but that's a story for another day...

[1] https://yourlabs.io/pyratzlabs/pymich/-/blob/master/pymich/m...

globuous··on Reinstating our SAT/ACT requirement for future admissions cycles
What's surprising though, is that APs and similar exams are not enough. In the UK, I though they essentially looked at A Level results, which are much more representative of what you'll actually study at uni. But I guess both SAT/ACTs & APs must be a better measure that just APs. I just remember fucking hating studying for the SATs though. So boring. SAT IIs were somewhat fun to study for though. In France for instance, they mostly just look at the baccalaureat to get into prep schools / first year at uni. Then exams to get into engr/business/vet schools are actually very interesting topics and very close to what you'll actually study. Same with exams at the end of the first year of med school (which you get into right after 12th grade, unlike in the US where it's after your bachelors).

That being said, they seem to have backed up their numbers, and MIT knows how to count, so they must be right! I just always hoped SAT/ACTs weren't that conclusive so that we didn't have to go through them anymore and could focus on the funner AP/A Level stuff :)

globuous··on A Proposal for Type Syntax in JavaScript
Are python type annotations enforced at runtime ? I'm pretty sure they're not
globuous··on The first day of HN frontpage
That makes a lot more sense, all the usernames are green, unlike the posted link ;)
Page 1 of 11Next →