Hacker News new | past | comments | ask | show | jobs | submit | more flylikeabanana's comments login

The contrast between text and background is way too low. I have "good" eyesight and strained to read the blog post


Update: we boosted the text contrast and we'll make some more visual improvements to the Blog throughout the day, too.


Appreciate the feedback, we can likely tweak the colors a little!


Nit: It's a proper noun "Emacs" unless you're maybe referring to the executable "emacs", but at any rate the eMac was a computer sold by Apple in the education sector, and eMacs is the plural of that. Your iOS device is likely autocorrecting to that spelling, because to Apple, what else could you possibly be referring to?


FP in python is painful without tail call elimination and the higher-order function syntax is so clunky


JS also doesn't have TCE, but for Python even just the lambda limitations are surprisingly annoying. I can't tell you how many times i've been frustrated because it's nearly impossible to put a print statement into a python lambda


As a Python enjoyer, why do we want to shove so much into lambdas rather than just doing an inline function `def`?

Is it the fact that you have to give it a name? If so I'd say just using some generic name like `{f,fn,func(tion),callback,etc}` is fine (at least as much as an anonymous function is), and to me would usually be more readable than an inline definition of a multi-statement lambda would be.

Or maybe it's the fact that lambdas are allowed in the first place, so people are going to use them, and then when you want to debug a lambda you'll probably have to go to the trouble of changing it to a function? That is a fair complaint if so.

In any case I can see how it could be annoying if you're more used to a language full of complex inline lambdas.


JS also kills Python for inline functions thanks to hoisting.

It's much easier to follow the control flow with hoisting. I see `run()` being called, and then I want to know what it is. In other languages you are usually seeing a huge bunch of inline functions and then asking: okay, but when and how is this actually called?

    def foo():
      def run():
        print("hi")
      run()

    function foo() {
      run()
      function run() {
        console.log('hi')
      }
    }


honestly I don't like this style of writing... in your js example I see `run()` and my first though is where the hell is run defined? is a global? I don't search - nor I write - the called function AFTER the calling ones, it seems backward to me.

moreover... basically any half-decent programmer text editor has an outline with the list of functions, so this point may be moot in any way


Lambda is quite clunky. A lot is possible by abusing tuples and walrus assignment, which Ive on occasion used for one liners. e.g. you want to execute a function for each element of a list (print is a function in py3) so mapping over a generator with eg

    map(lambda x: (x := func1(x), func2(x), None)[2], gen())
This sets x to func1(x), then executes func2, then leaves None in place of the element in the map iterable. (of course you could do the same with a list comprehension, you wouldn't even need the lambda in that case, and good python would _actually_ be a for loop.)


That's a mismatch between Python's choice of lambda syntax and the use of whitespace instead of curly braces.


lambda x: print(x) or x


JS technically does have TCE (specified in ES6[1]), but only the JavaScriptCore runtime used by Safari/WebKit implements it[2].

[1]: https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-... [2]: https://kangax.github.io/compat-table/es6/#test-proper_tail_...


> Pointing to google as a positive example hasn’t made sense in quite some time.

I don't usually get pedantic about typos, but the twofer here really made it hard to understand what you were saying


I'm ignorant. What is incorrect?


Looks like "since" vs "sense" or "quiet" vs "quite"

I didn't notice either until flylikeabanana pointed it out


Hah, I was reading his quoted response looking for the problem and didn't realize he changed the spellings in the quote. Got it, thanks.


Daniel Spiewak has posted a perspective before. The TL;DR is that Loom makes the implementation of CE/ZIO more straightforward, but it probably won't replace the effect systems themselves since they offer a lot more than just "light threads":

https://www.reddit.com/r/scala/comments/sa927v/comment/htsoy...


Also John Kennedy Toole, his novel The Confederacy of Dunces was published by his mother after his suicide and it ended up winning the Pulitzer.


Let's say I block all Tor users for my website, because the level of abuse that Tor enables means an overwhelming amount of the malicious traffic I encounter comes from Tor. Am I painting all Tor users with the same brush here, or am I just min-maxing my time and energy trying to wrangle all the crap?


Er, yes; if you block every TOR user then obviously you're painting them all with the same brush.


That phrase is usually referring to some sort of judgement or characterization, not a particular action. If a teacher makes the whole class stay late because a few were acting up, that's not painting with the same brush. If you think that all children are disruptive because a few acted up, that is.


> If a teacher makes the whole class stay late because a few were acting up, that's not painting with the same brush

Huh, I'd think it is. Class goes home, and the acting up go to the principal is the regular non-sweeping treatment.


Ok but in both the case of HN and TOR, you're making a judgement about the kind of people on there. There's nothing inherently wrong with traffic from a TOR router, it's the users on there. HN referrals are similarly not a problem per se.


Hm, I suppose that's a distinction that can be made. OTOH, I think someone posting

> In addition, we find that only a tiny fraction of HN comments (often less than 1%) actually engage with the substance of our articles, with the majority being off-topic, misinformative, repetitive, or otherwise of low quality, making the overall value of HN exposure overwhelmingly negative for our project.

very much is judging the actual people.


You're doing both. The TOR users would probably not be happy, but if you don't want them you don't want them. Now do you want to ban TOR users (probably doing illegal stuff) or HN users (mostly just normie SWEs)?


Isn't this the difference between concurrency and parallelism? Like you said, Tokio (I'm coming from effect systems in Scala, the current generation of which take heavy inspiration from Tokio) is good for informing your program when your code is blocked so it can perform some useful work elsewhere, which is a fundamentally different problem to parallelizing code. So if I'm understanding your complaint right it's that Tokio sneaks in when its concurrency features aren't particularly useful for parallelization?


Correct.

I have an unusual application, a metaverse client for big 3D worlds. It has to deal with a flood of data while maintaining a 60 FPS frame rate. It's essential that the rendering thread(s) not be delayed, even though other background threads are compute bound dealing with a flood of incoming 3D assets. This does not fit well with the async model.

This sort of thing comes up in games, real time control, and robotics, but is not something often seen in web-related software.


> This sort of thing comes up in games, real time control, and robotics, but is not something often seen in web-related software.

I think you're not familiar with web-related software.

> It's essential that the rendering thread(s) not be delayed, even though other background threads are compute bound dealing with a flood of incoming 3D assets.

This is exactly how the browser behaves, and why Javascript needs to be entirely async on the main thread.

For your application it should be very easy to spin up a render thread (pinned to a single core or whatever priority mechanisms you want to use) that loops, and use message passing to get the results from Tokio based futures.


Not OP, but I think the problem they are trying to explain is that if you create an async function it can only be called from other async functions, so it's quite an infectious concept.

If you create a library that uses async, you're forcing everybody that uses the library into async as well (with the same executor).

If somebody writes a library now that's generally useful but uses async, it forces others to use async or rewrite the library themselves.

On the one hand a lot of people put this down as whining about free code, which is somewhat true, but the infectious nature makes the whole ecosystem less useful if you want to build something non-async.


I think this is not true. I found a way (in the async book or tokio documentation, somewhere near the end of the docs or end of a quick-start guide or such) to just call it and not have to make the calling function async, using runtime.block_on() .

If you request here or via the email at my web site (in profile), I can provide a more detailed example from a test I have.

(note to self: see fn test_basic_sql_connectivity_with_async_and_tokio() .)


Pinning is first-class with the new flake method. When you create a flake, a corresponding flake.lock is created, similar to lock files in other languages. There's even a dedicated command now to upgrade the dependencies declared in a flake.


Yes, I think I get that. But it is not easy to pin on different packages. For example if I want golang 1.18, node 12, I need to find the commit corresponding to those and add them. I mean it is possible but not as easy as it should be.


There's often a bunch of different versions in nixpkgs. For example, postgres currently has 11 through 15 available (https://github.com/NixOS/nixpkgs/blob/e7f345ca81f4f5513c4e73...). Nodejs has 14, 16, 18, and 19 (https://github.com/NixOS/nixpkgs/blob/e7f345ca81f4f5513c4e73...).


Finding a way to install a specific version - not git commit or git tag, version - of a package is the problem.

https://github.com/NixOS/nixpkgs/issues/93327

Nix before flakes used channels, each with a flat global namespace. Flakes are intended to sit inside the git repo, so that's even less discoverable.

Nix solves practically every technical problem, but has terrible UX and documentation.


Org mode tables have a lot to polish though. I'd love to see word wrapping in org tables but the current solutions all leave a lot to be desired


Sure - it's a long time since I used it so I'll take your word for that. But it demonstrates the principle.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: