Readit News logoReadit News
Throwaway23459 commented on Beyond Functional Programming: The Verse Programming Language [pdf]   simon.peytonjones.org/ass... · Posted by u/WillPostForFood
moloch-hai · 3 years ago
Your lecturer did you a disservice; clearly he only knew C, and didn't want to learn any more.

The more your C++ code resembles C, the worse it is.

Throwaway23459 · 3 years ago
Maybe he only knew C as you say. I did C++ professionally for a while. Not properly, just updating models in derivatives trading systems. I remember reading 3 Scott Meyer books, the Effective Programming series, at the time, they were a tour de force. Loved that guy. I've lost track of everything since 11 or whenever they introduced move semantics. One day I might go back to it.
Throwaway23459 commented on Beyond Functional Programming: The Verse Programming Language [pdf]   simon.peytonjones.org/ass... · Posted by u/WillPostForFood
justinhj · 3 years ago
That kind of code is sometimes easier to write than read… you build it up incrementally. On the other hand it’s easy to refactor this to make it readable. Is Haskell supposed to be an easy language for beginners? Is Verse? Not every language should be.
Throwaway23459 · 3 years ago
> [Paraphrasing] Is Verse supposed to be an easy language for beginners ?

Yes! Well that was the point of my comment. Maybe you have a different interpretation of 'Learnable as a first language' from the article, which is fine, not interested in arguing about that.

Throwaway23459 commented on Beyond Functional Programming: The Verse Programming Language [pdf]   simon.peytonjones.org/ass... · Posted by u/WillPostForFood
davidw · 3 years ago
I'm not sure about the "learn it as a first language" bit.

    x:=(1|2); y:=(7|8); (x,y)
This stuff just doesn't seem intuitive to me. It's not verbose enough to be obvious to someone who doesn't know what's going on.

Looks interesting though; that's a really bright group of people. Be curious to see where their project ends up.

Throwaway23459 · 3 years ago
Has it got currying? Partially applied functions passed around in folds and traverses are horribly difficult to read for beginners. Example: an Advent of Code solution posted in r/haskell for Day 10 this year, tell me how long it takes you to understand the function cycleStrengths.

   signalStrength cycle x = cycle \* x

   cycleGaps = [19, 40, 40, 40, 40, 40]

   cycleStrengths = foldr a (const []) cycleGaps . (\x -> (1, x))
     where
       a n r (i, xs) = signalStrength m y : r (m, ys)
         where
           m = i + n
           ys@(y : _) = drop n xs
From: https://www.reddit.com/r/haskell/comments/zhjg8m/advent_of_c...

Personally I love this headscratching stuff, but I would not ever dream of subjecting it upon a beginner programmer.

Throwaway23459 commented on Beyond Functional Programming: The Verse Programming Language [pdf]   simon.peytonjones.org/ass... · Posted by u/WillPostForFood
bibanez · 3 years ago
In my uni they still teach C++ as a first language, that's why the "don't learn it as a first language" got me confused. The core language is very useful for learning programming, it is actually very clean.
Throwaway23459 · 3 years ago
My lecturer in second year, > 20 years ago mind, said we are learning C, because C++ is C with an ugly object oriented graft on top.
Throwaway23459 commented on Beyond Functional Programming: The Verse Programming Language [pdf]   simon.peytonjones.org/ass... · Posted by u/WillPostForFood
rkrzr · 3 years ago
This looks incredibly ambitious:

- There are no booleans in the language! Conditionals can still succeed or fail, but failure is defined as returning zero values and success is defined as returning one or more values.

- Verse uses a so-called 'lenient' evaluation strategy which is neither strict nor lazy, but somewhere in-between ("Everything is eventually evaluated, but only when it is ready")

- an expression does not evaluate to a value (like in Haskell), but instead to a sequence of zero or more values

- tries to bring functional logic programming into the mainstream

- Verse uses an effect system for I/O instead of monads

- A type in Verse is "simply a function". E.g. int is the identity function on integers, and fails otherwise

This all looks very mind-bending to me (in a good way). Perhaps Verse will one day be as influential for PL design as Haskell has been.

Throwaway23459 · 3 years ago
> so-called 'lenient' evaluation strategy which is neither strict nor lazy, but somewhere in-between

Sounds like we are still clinging on to laziness in some regard, I wish we could get shod of it entirely. Although laziness makes doing Leetcode problems in Haskell really fun, Idris got it right when they opted for strict evaluation for predictable memory performance.

Throwaway23459 commented on Breaking up with JavaScript front ends   triskweline.de/unpoly-rug... · Posted by u/hdjjhhvvhga
ttfkam · 3 years ago
Apparently you've never heard of event delegation, which has been around for at least twenty years? (I could swear I was using it on IE6, but I might be misremembering.) At any rate, the plain JS way of handling 50,000+ HTML buttons efficiently is a long-solved problem.

https://javascript.info/event-delegation

Throwaway23459 · 3 years ago
You appear to be reading more into my post then I intended. The point I was illustrating is that there is no cruft in React.

Try and keep your posts factual.

Throwaway23459 commented on Ask HN: How to get back into AI?    · Posted by u/quibono
jdeaton · 3 years ago
I am an ML researcher working in the industry: by far the most effective way to maintain/advance my understanding of ML methods is implement the core of an interesting paper and reproduce (some) of their results. Completing a working implementation really forces your understanding to be on another level than if you just read the paper and think "I get it". It can be easy to read (for example) a diffusion/neural ode paper and come away thinking that you "get it" while still having a wildly inadequate understanding of how to actually get it to work yourself.

You can view this approach in the same way that a beginner learns to program. The best way to learn is by attempting to implement (as much on your own as possible) something that solves a problem you're interested in. This has been my approach from the start (for both programming and ML), and is also what I would recommend for a beginner. I've found that continuing this practice, even while working on AI systems professionally, has been critical to maintaining a robust understanding of the evolving field of ML.

The key is finding a good method/paper that meets all of the following

0) is inherently very interesting to you

1) you don't already have a robust understanding of the method

2) isn't so far above your head that you can't begin to grasp it

3) doesn't require access to datasets/compute resources you don't have

of course, finding such a method isn't always easy and often takes some searching.

I want to contrast this with other types of approaches to learning AI with include

- downloading and running other people's ML code (in a jupyter notebook or otherwise)

- watching lecture series / talks giving overviews of AI methods

- reading (without putting into action) the latest ML papers

all of which I have found to be significantly less impactful on my learning.

Throwaway23459 · 3 years ago
Most recent papers, in NLP at least, are so sparse on detail that it is impossible to reproduce their models. And then there's the compute cost, as at least one other poster has mentioned.
Throwaway23459 commented on Breaking up with JavaScript front ends   triskweline.de/unpoly-rug... · Posted by u/hdjjhhvvhga
t8sr · 3 years ago
Alternatively, web developers could calm down and just write mostly HTML with some plain javascript where warranted.

I've recently done some web development for the first time in 12 years, and I was horrified at all these pointless frameworks that break every usability win web browsers have made in the past 20 years, cost extra bandwidth and have atrocious performance. Like, why? Can web devs really not learn the 4 functions that make up the websockets API? Do they really need a special framework named after a coffee bean?

This kinda crap is why the gmail tab uses a GB of memory.

Throwaway23459 · 3 years ago
React and Angular are both blazing fast, and are definitely not pointless. Open create react app, spin up a page with 50000 buttons, compare that to a plain js version, then come back and tell us about the atrocious performance.
Throwaway23459 commented on Breaking up with JavaScript front ends   triskweline.de/unpoly-rug... · Posted by u/hdjjhhvvhga
t8sr · 3 years ago
According to my browser, the default view in gmail needs 8.32 MiB of javascript spread over 90 files to render.

While IDLE, the gmail tab uses 10-30% of an M1 CPU core.

That stuff is not down to tracking - it's because the damn thing keeps messing with the DOM, because it has some insane structure where javascript controllers are attached as strings to DOM elements, because it uses about 100 divs to render every row in the list of messages, and because every message is nested literally 15-30 layers deep in a pointless tree of divs.

I am sorry, but web frontend is an insane dumpster fire.

Throwaway23459 · 3 years ago
Well google use all of their own internal 'frameworks', so you can't really use their web applications to judge the rest of the web.
Throwaway23459 commented on Tell HN: OpenAI Whisper Is Overfitted    · Posted by u/lostmsu
Throwaway23459 · 3 years ago
Does Whisper ever respond with "I don't understand" or does it always try to amble on and give an answer, no matter the confidence of the prediction?

u/Throwaway23459

KarmaCake day27October 16, 2022View Original