Hacker Newsnew | past | comments | ask | show | jobs | submit | ngrilly's commentslogin

That’s why most banks ask you to approve transactions with an explicit reauthentication.


Then the malware will just wait until you want to do something legitimate that needs that, and then swap it out for its own thing.


I've never seen a "normal" user not confused by the difference between Teams's teams and Teams's channels (where every "channel" belongs to a "team"). I'm pretty sure that's reason #1 why most users use only group chats and never use channels. They simply don't understand how it works because it's too confusing.


Your blog posts (that I read a few weeks ago) and your comment here are the best explanations I've ever read on this topic. You're not just looking at the surface of the problem, but diving in the why it is like that, semantically. I really like that you mentioned dependent typing in your conclusion.


I have the same issue with Helix not watching and reloading modified files automatically, as I sometimes run external programs modifying those files (templ and sqlc are good examples). Curious about how experienced Helix users are addressing this.


I have file reload binded to key:

    [keys.normal.space.f]
    f = "file_picker_in_current_directory"
    F = "file_picker"
    b = "file_picker_in_current_buffer_directory"
    "." = ":toggle-option file-picker.git-ignore"
    g = "global_search"
    e = "file_explorer"
    r = ":reload-all"
    x = ":reset-diff-change"
    w = ":echo %sh{git blame -L %{cursor_line},+1 %{buffer_name}}"


I've been trying Helix and really like it. But as someone coming from VS Code, I've been relying a lot on VS Code automatically saving and restoring sessions on restart (things like opened files, unsaved files, cursor position, etc.). It's helpful when I occasionally restart my computer. How do you that in Helix (or for that matter in Neovim)?


I don't know about Helix but Neovim (and vim) has something called sessions and it does everything but unsaved files. By default it's manual but it wouldn't be too difficult to automate. A very simple way could just create/update the session on BufWritePost and ExitPre. Then create an alias to open Neovim with that session: 'nvim -S .session.vim'.

You'll get an error if the session doesn't exist but it's easy to dismiss. There are probably plugins that do this in a more seamless way though if you prefer.


&42 would not work because constants don’t have a type. But &int64(42) could.


Full agree. Value types are underrated. That's one of the best things about C# and Go. They are increasing performance (with contiguous memory) and reducing GC pressure. I also believe that dynamically typed languages like Python would gain a lot by introducing a form of value types/unboxed values. For example, Cinder, Meta's internal version of CPython, supports what they call "static classes": https://github.com/facebookincubator/cinder?tab=readme-ov-fi....


The fact that the types are reflected at runtime is what makes FastAPI/Pydantic possible, letting us use Python types to define data models used for serialization, validation, and generating. In TypeScript, we have to use something like Zod, instead of "normal" TypeScript types, because the types are not reflected at runtime.


I think a couple of things have to be untangled here.

The problem we are talking about in both Python and TS comes from the fact that they are (or compile down to) dynamic languages. These aren't issues in statically typed languages... because the code just won't compile it it's wrong and you don't have to worry about getting data from an untyped library.

I don't know a lot about Zod, but I believe the problem you are referring to is more about JavaScript then TS. JavaScript does a LOT of funky stuff at runtime, Python thank God actually enforces some sane type rules at runtime.

My point was not about how these two function at runtime. My point was that if you want to tac static typing onto a dynamic language, Typescripts approach is the better one, but even if can't fix the underlying issues with JS.

You could take a similar approach in Python. We could make a language called Tython, that is statically typed and then compiles down to Python. You eliminate an entire class of bugs at compile time, get a far more reliable experience then the current weirdness with gradual typing and linters, and you still get Pythons runtime type information to deal with things like interopt with existing Python code.


Then that means we have to define the interface twice: once in TypeScript and another in Zod?


No. Zod gives you TypeScript types corresponding to the schema. So you would only need to write the schema in Zod.

(I do wish it could be the other way, though: Write only TypeScript, get runtime checks automatically.)


There are ways if you're ok with a build step, e.g. https://typia.io/ or https://github.com/GoogleFeud/ts-runtime-checks

Although perhaps that's not what you mean.

I found these through this https://github.com/moltar/typescript-runtime-type-benchmarks


I'm familiar with zod.infer but I'm not sure how to use it to produce an interface that would be compatible with RpcStub and RpcTarget, like MyApi in the example in your post:

  // Shared interface declaration:
  interface MyApi {
    hello(name: string): Promise<string>;
  }

  // On the client:
  let api: RpcStub<MyApi> = newWebSocketRpcSession("wss://example.com/api");

  // On the server:
  class MyApiServer extends RpcTarget implements MyApi {
    hello(name) {
      return `Hello, ${name}!`
    }
  }


I'll be honest and say I haven't tried it myself.

But my expectation is you'd use Zod to define all your parameter types. Then you'd define your RpcTarget in plain TypeScript, but for the parameters on each method, reference the Zod-derived types.


I learned about Luau via my 13 years old who is looking into Roblox Studio. That's how I ended up visiting luau.org and I'm quite impressed by Roblox's engineering on this.


Arseny Kapoulkine is an amazing engineer. Highly recommend following his blog or social media. Other than working on luau and the rendering engine at Roblox, he's also responsible for meshoptimizer which if you're in graphics you've most definitely heard of, and volk, which now comes packaged with the Vulkan SDK.


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

Search: