frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

VCF West: Whirlwind Software Restoration – Guy Fedorkow [video]

https://www.youtube.com/watch?v=YLoXodz1N9A
1•stmw•1m ago•1 comments

Show HN: COGext – A minimalist, open-source system monitor for Chrome (<550KB)

https://github.com/tchoa91/cog-ext
1•tchoa91•1m ago•0 comments

FOSDEM 26 – My Hallway Track Takeaways

https://sluongng.substack.com/p/fosdem-26-my-hallway-track-takeaways
1•birdculture•2m ago•0 comments

Show HN: Env-shelf – Open-source desktop app to manage .env files

https://env-shelf.vercel.app/
1•ivanglpz•6m ago•0 comments

Show HN: Almostnode – Run Node.js, Next.js, and Express in the Browser

https://almostnode.dev/
1•PetrBrzyBrzek•6m ago•0 comments

Dell support (and hardware) is so bad, I almost sued them

https://blog.joshattic.us/posts/2026-02-07-dell-support-lawsuit
1•radeeyate•7m ago•0 comments

Project Pterodactyl: Incremental Architecture

https://www.jonmsterling.com/01K7/
1•matt_d•7m ago•0 comments

Styling: Search-Text and Other Highlight-Y Pseudo-Elements

https://css-tricks.com/how-to-style-the-new-search-text-and-other-highlight-pseudo-elements/
1•blenderob•9m ago•0 comments

Crypto firm accidentally sends $40B in Bitcoin to users

https://finance.yahoo.com/news/crypto-firm-accidentally-sends-40-055054321.html
1•CommonGuy•9m ago•0 comments

Magnetic fields can change carbon diffusion in steel

https://www.sciencedaily.com/releases/2026/01/260125083427.htm
1•fanf2•10m ago•0 comments

Fantasy football that celebrates great games

https://www.silvestar.codes/articles/ultigamemate/
1•blenderob•10m ago•0 comments

Show HN: Animalese

https://animalese.barcoloudly.com/
1•noreplica•10m ago•0 comments

StrongDM's AI team build serious software without even looking at the code

https://simonwillison.net/2026/Feb/7/software-factory/
1•simonw•11m ago•0 comments

John Haugeland on the failure of micro-worlds

https://blog.plover.com/tech/gpt/micro-worlds.html
1•blenderob•11m ago•0 comments

Show HN: Velocity - Free/Cheaper Linear Clone but with MCP for agents

https://velocity.quest
2•kevinelliott•12m ago•2 comments

Corning Invented a New Fiber-Optic Cable for AI and Landed a $6B Meta Deal [video]

https://www.youtube.com/watch?v=Y3KLbc5DlRs
1•ksec•13m ago•0 comments

Show HN: XAPIs.dev – Twitter API Alternative at 90% Lower Cost

https://xapis.dev
2•nmfccodes•14m ago•1 comments

Near-Instantly Aborting the Worst Pain Imaginable with Psychedelics

https://psychotechnology.substack.com/p/near-instantly-aborting-the-worst
2•eatitraw•20m ago•0 comments

Show HN: Nginx-defender – realtime abuse blocking for Nginx

https://github.com/Anipaleja/nginx-defender
2•anipaleja•20m ago•0 comments

The Super Sharp Blade

https://netzhansa.com/the-super-sharp-blade/
1•robin_reala•22m ago•0 comments

Smart Homes Are Terrible

https://www.theatlantic.com/ideas/2026/02/smart-homes-technology/685867/
1•tusslewake•23m ago•0 comments

What I haven't figured out

https://macwright.com/2026/01/29/what-i-havent-figured-out
1•stevekrouse•24m ago•0 comments

KPMG pressed its auditor to pass on AI cost savings

https://www.irishtimes.com/business/2026/02/06/kpmg-pressed-its-auditor-to-pass-on-ai-cost-savings/
1•cainxinth•24m ago•0 comments

Open-source Claude skill that optimizes Hinge profiles. Pretty well.

https://twitter.com/b1rdmania/status/2020155122181869666
3•birdmania•24m ago•1 comments

First Proof

https://arxiv.org/abs/2602.05192
8•samasblack•26m ago•3 comments

I squeezed a BERT sentiment analyzer into 1GB RAM on a $5 VPS

https://mohammedeabdelaziz.github.io/articles/trendscope-market-scanner
1•mohammede•28m ago•0 comments

Kagi Translate

https://translate.kagi.com
2•microflash•28m ago•0 comments

Building Interactive C/C++ workflows in Jupyter through Clang-REPL [video]

https://fosdem.org/2026/schedule/event/QX3RPH-building_interactive_cc_workflows_in_jupyter_throug...
1•stabbles•29m ago•0 comments

Tactical tornado is the new default

https://olano.dev/blog/tactical-tornado/
2•facundo_olano•31m ago•0 comments

Full-Circle Test-Driven Firmware Development with OpenClaw

https://blog.adafruit.com/2026/02/07/full-circle-test-driven-firmware-development-with-openclaw/
1•ptorrone•31m ago•0 comments
Open in hackernews

Python-Style Kwargs in TypeScript

https://xavd.id/blog/post/python-kwargs-in-typescript/
13•ingve•4mo ago

Comments

lloydatkinson•4mo ago
I don't really like this at all. I'm not familiar with Python but this kwargs sounds like it leads to inconsistency throughout usages of a function.

In JS/TS it's a lot more conventional to use objects once you go past 2-3 arguments. Sometimes patterns from other languages are great in other languages (like, functional ways of modelling errors, making invalid state impossible, not using nulls, etc), but other patterns like the one shown here don't seem great.

rafram•4mo ago
Hmm? “Use objects once you go past 2-3 arguments” seems to be exactly what this post is arguing for. (Which, as you say, is not novel and is common in browser APIs and other JS libraries.) Not sure what you’re disagreeing with.
nrawe•4mo ago
I agree the problem, but the given solution feels a bit clunky to me. From a syntax perspective, passing an options object and applying it over a set of defaults feels a lot cleaner. The reason kwargs work in Python is primarily because the syntax is clean on both the caller and callee's side of things. This puts a lot of additional non-obvious syntax on the callee side.
jarredkenny•4mo ago
TLDR: Typescript has objects and destructuring. If you squint it kinda looks like Python's kwargs, because both JS objects and Python kwargs are simply key value pairs.
lerp-io•4mo ago
Object destructuring with default parameters is a JavaScript feature.
SwiftyBug•4mo ago
I use that approach to group options in a single parameter. But then not only the options parameter must be nullable, but also its properties:

function findAll(tableName: string, opts?: { where: Record<string, any>; limit?: number; sort?: "DESC"| "ASC" }) {}

williamdclt•4mo ago
My personal philosophy, which isn't shared by many but I'm yet to find it failing me: (almost) never use default arguments. It's bad design and causes real issues, between bugs and incidents I've been involved in dozens of situations where I've found that "this would never have happened if this argument didn't have a default value".

First, there's very rarely a value that really makes sense to be the "default". People often use a default value when it's a "commonly used" value: I don't think it's a good reason, other values usually are just as valid and important as the most-commonly-used value. It's like saying someone in Sweden is "white by default" because it's the most common case: it's going to be often correct but _why would you do that_ when you could just make it explicit. The typing you're saving isn't worth it.

Second, it makes your API less easy to use. Devs _should_ read through all the available arguments anyway to make your function do what they want, including these default arguments (even if they decide not to set them), so what did you gain from making them optional? A bit of typing, a bit of screen real estate? Sure, but devs _do not actually behave like that_ and often don't read or don't pay enough attention to optional arguments. They just (consciously or not) hope that the default values will be reasonable for their specific use-case. Well, too often it's not and that result in a bug or incident: the typing and screen estate you gained are not worth it. FORCE devs to think about what's the correct value, that's good design.

Third, it's much less readable. The reader doesn't know that there are invisible arguments with an implicit value, despite these arguments modifying the behaviour of the function. Make everything explicit and no-one needs special implicit knowledge to know what a function is doing (even Python says "explicit is better than implicit").

Fourth, what would make sense as a default at some point might not make sense later. You pick a default that seems to make sense, people use this default value all over the place, things change and actually new use-cases usually need a different value... well sucks to be you. Now you have a footgun, as it's not even a good default for new use-cases and it's more likely to be misused, or you need to go over all previous use-cases to give an explicit value so that you can change the default... might as well have never made it a default.

There's exceptions of course: I wouldn't want `key` or `className` to be explicit in React, but for 99% of backend stuff, default values are a bad design. I hate Go for this: zero values have caused _countless_ issues to almost everyone I know, whether they acknowledge it or not.

egroat•4mo ago
I was going to disagree with you; and I was going to use a very simple function to do it `randString(length, alphabet)` where alphabet is defaulted - as azAZ09 is a good default.

However, on many non-trivial projects I've worked on we ended up making the default explicit and then creating wrappers for specific use cases (i.e. randFileName, randFilePath not being case sensitive on some platforms and randTestFilePath including additional characters for tests but production variants sticking to portable sets).

Its further worth noting that rarely do I allow the default global random to be used and instead dependency inject it via params/factories.

WorldMaker•4mo ago
JS is a fun language where argument defaults can accidentally shoot you in the foot because of no runtime type checking of argument application. With your example, you might want to map a bunch of lengths through it, which in simplest form might look:

    someLengthArray.map(randString)
The classic surprise is that map provides 2 arguments with the second argument being the index of the array. Depending on how `randString(length, alphabet)` uses its alphabet it might just use the string form of the index so you accidentally get random strings of n length '0' then '1' then '2', etc.

(The most common case of this problem in JS is probably `parseInt(string, radix = 10)`. Accidental arbitrary radix from an index parameter is a fun way to get unexpected numbers back from your array of strings.)

lbreakjai•4mo ago
The first code example on the article is wrong. It would print "!, Bob." and not "Hello, Bob!".
Waterluvian•4mo ago
I don’t like how dang busy it gets. What I do is if I need more than a few args, I accept only an object. And offer only type information in the signature, and resolve default values at the start of the function. It even works nicely if all args are optional.
game_the0ry•4mo ago
^^ this

I would probably do the same before using kwargs.

Izkata•4mo ago
They are passing "prefix", "ending", and "extraNames" in an object. It's just defined inline in the function and using destructuring so the function can access the keys by name without having to put the object in a variable (and the default values are part of the object destructuring).
Waterluvian•4mo ago
Yeah but to have half-decent typings you then have to define the entire type, again, in the signature.
thrance•4mo ago
So, an entire article just telling you to put objects as the last parameters to functions? Wow thanks, I'd have never thought of that.
Garlef•4mo ago
TL;DR + Some extra:

* 1-2 args: fn(arg1, arg2)

* More args: fn({ arg1, arg2, arg3, ... })

* Sometimes: fn(mainArg, { ...optionObject })

sestep•4mo ago
I personally kind of feel like no existing language provides great syntax for structured function parameters. I recently wrote a post about how I think languages could make this better in general (although one thing I didn't tackle in my post is default values for arguments, which is very important): https://samestep.com/blog/parameter-syntax/
instig007•4mo ago
You can do most of it in default Haskell syntax, plus `RecordWildCards`: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/reco...
sestep•4mo ago
Oh interesting; is that actually true? I'm not aware of Haskell features that allow it to do better than any of the three other languages I compared to in my post. What would my running example look like in Haskell?
instig007•4mo ago
Here's the sample you can play with (interactive: https://play.haskell.org/saved/TWBEYFzH):

  {-# LANGUAGE RecordWildCards #-}


  main =
    transport
      ("2025-09-05T09:00:00Z", "2025-09-05T11:00:00Z")
      foo123
      kwargs
    where
      foo123  = Foo
      kwargs  = Kwargs {..}
      bar     = Bar
      person  = Person {..}
      name    = "Alex Smith"
      phone   = "+1 (555) 555-5555"
      options = Opts {..}
      fragile = True
      window  = PM


  data Foo = Foo
  data Bar = Bar

  data Kwargs = Kwargs
    { bar     :: Bar
    , person  :: Person
    , options :: Opts
    }

  data Person = Person
    { name  :: String
    , phone :: String
    }

  data Opts = Opts
    { fragile :: Bool
    , window  :: HalfDay
    }

  data HalfDay = AM | PM


  transport (start, end)
            foo
            Kwargs { person = Person{ name = who, ..}, options = Opts{..}, ..}
    = do
      doStuff who foo
      moreStuff phone end window
      otherThings start fragile bar


  doStuff who foo               = print "called doStuff"
  moreStuff phone end window    = print "called moreStuff"
  otherThings start fragile bar = print "calle otherThings"
instig007•4mo ago
To address the example towards the end of your post, if you want patterns + struct binding at the same time, prefix patterns with `bindName@`, for instance:

  transport
    myTuple@(start, end)
    foo
    kwargs@(Kwargs { person = Person{ name = who, ..}, options = Opts{..}, ..})
  = do
      ...
sestep•4mo ago
I see, so similar to the other languages I mentioned in my post, it looks like Haskell doesn't let you colocate the types with the leaves of the binding form?
instig007•4mo ago
> doesn't let you colocate the types with the leaves of the binding form

Can you elaborate on the effective difference between colocations in your example and this:

  transport Kwargs {person = Person{name = who, ..}, options = Opts{..}, ..}
The `Kwargs{..}` alone does imply a non-ambiguous type in the function signature (without explicit but optional annotations), and it binds locally scoped names too. Why doesn't it colocate in the same sense?
sestep•4mo ago
It's similar to the Rust example from my post: there are no anonymous records, so in order to be able to construct something with named fields, you need to first define those record types outside. In contrast, my proposed syntax depends on already having anonymous record types like OCaml and TypeScript do, but avoids the extra boilerplate required by separating types from binding forms as shown in my TypeScript example.
instig007•4mo ago
But structural typing that allows you defining anonymous record types is orthogonal to colocation of types and bindings. You're effectively saying that you're proposing a type system that supports structural types, syntax and colocation don't have much to do with it.
sestep•4mo ago
Could you clarify what you mean? TypeScript already has structural types, but I already examined it in my post; if that were the only thing I was saying then my post would have just used TypeScript at the top.
quink•4mo ago
Just make it a well-defined class.

Like option structs in Go. Simple.

seivan•4mo ago
That would pollute the namespace. The type could be namespaced under the function signature, it's not its own type unless you extract it with FunctionParamater<typeof ..>[0] or along those lines.
seivan•4mo ago
I wish rust and typescript had this builtin. Obj-C and Swift spoiled me. Named/keyword arguments is worth the verbosity. Maybe not Obj-C-tableViewcellForRowAtIndexPath level, but still.