Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The single best way to avoid dependencies is to use a language with a large standard library.

Given the variance in standard library coverage, it’s rarely productive to argue about this topic in a language agnostic way. Using only stdlib in Go is very different from using only stdlib in JavaScript.



The best way to avoid dependencies is to use a language that is built in a way such that dependencies are worthless. Like APL, J, or kdb+/q. All of these languages are incredibly small, have almost non-existent standard libraries, and yet are designed in such a way that a large standard library becomes superfluous.

Having a large standard library speaks poorly of the composability and orthogonality of language primitives.


Sure, if the problems you are solving are well suited for languages like APL, J or kdb+/q...


Call me an iconoclast, but I think array languages are more suitable for general purpose programming than even general purpose languages.


As someone who is not well versed in APL/J/K, how do they deal with structured data like JSON? Is there some sort of DSL like jq built into them?


Because kdb+/q has such few datatypes and you can't define anymore, it's very easy:

  q) .j.k"[2.2, 3.5]"
  2.2 3.5
Serialization is also trivial:

  q) .j.j 0 1 2 3
  "[0,1,2,3]"
In general, sending stuff across memory boundaries (files, network, ram, etc) is exceedingly trivial in kdb+/q. To execute a function on a remote server, simply connect to a server and send across the call to the handle. For example, to send synchronously compute 1+1:

  q) h:hopen `::6666
  q) h(+;1;1)
  2
You can send over anything you want, even the entire source code of program to be executed! This is a really flexible environment, where you can create really powerful app-engines. All members of a cluster can send code, data, and messages to any other node, async or sync.

Much like Common Lisp and SmallTalk, you can easily connect to production nodes and modify code while the service is running.

It's rare to find such a dynamic, flexible, and interpreted language that also has world class performance, even often beating hand written C. Combined with an integrated database, you get a distributed system that can't be beat, at least performance-wise. And the craziest thing is that all of this sits in at 650kb executable with libc has the only dependency. And all probably in less lines of code than a simple javascript webapp!


i'm so used to python's stdlib that whenever i go to javascript i get legit angry.

i really like writing typescript code, but holy shit, when you have to pull libraries to even the smallest thing (lol left-pad), it get super infuriating.


JavaScript standard library was maybe bad in the past but nowadays they added a lot of features (yes, even left-pad).

Sure, if you know that you have to support old and broken browsers you have to use these dependencies to ensure correct support, but if you know that your code will run on a specific interpreter (for example a modern version of nodejs, or modern browsers) you don't have to worry about it too much.

Also most JavaScript programmers tends to abuse dependencies, I mean even for things that are really 10 lines of code that you write in 1 minute.




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

Search: