Better HN
topnewbestaskshowjobs
Log inSign up

wlib

284 karma · joined Jan 7, 2017 (9y ago) · 73 submissions

https://git.io/de
Submissions

comment 5y ago · link · parent

Not without some modifications, which I did not make because the complexity would get crazy with shell scripting

32.

Show HN: Run unknown shell script with a line-by-line confirmation prompt(gist.github.com ↗)

158 points · by wlib · 5y ago · 82 comments

33.

An HTML Quine(gist.github.com ↗)

1 points · by wlib · 5y ago · discuss

comment 6y ago · link · parent

Dependently typed Golang when??

In all seriousness, it feels like go's reputation of simplicity is at odds with its design. Instead of making a simple and highly generalized core from which anything can be composed, it has a specialized, familiar core that engineers are comfortable with.

When I take this question further, I begin to wonder why we even use text syntax for programming. What if we just had a graph structured programming "language" that is edited indirectly through different projected syntaxes that aren't necessarily monospaced text. Almost like lisp, but translated into different frontend languages, potentially graphical. (Maybe off topic but whatever)

comment 6y ago · link · parent

Glad to see this, a great related TED talk by Allan Savory that introduces why this is true can be found here https://youtu.be/vpTHi7O66pI

36.

Google search query takes 6 seconds(google.com ↗)

2 points · by wlib · 6y ago · discuss

comment 6y ago · link · parent

Say you have a simple expression within your code: 4+3*2. Rather than computing the result at run time, you can reduce (fold) that expression into 10, because it's a simple constant that only needs to be computed once.

comment 6y ago · link · parent

That's what I meant

comment 6y ago · link · parent

Isn't this solved perfectly with an affine or linear type-aware optimizing compiler? Where all data is immutable unless the types prove to the compiler that there are no mutation conflicts. I believe Rust implements this and Idris 2 does so as well with quantitative type theory.

comment 7y ago · link · parent

Interesting point. Lambda calc is equivalent, where the expression can be seen as equivalent to the ticker tape. So when a reduction occurs in lambda calculus, it's just like a group of symbols being interpreted and overwritten. But the thing is, no one has to overwrite the symbols to "reduce" them. It's just a space (memory) optimization. Usually to calculate something (you're fully correct by the way) we do overwrite symbols. The point of using immutable style is simply to make sure that references don't become overwritten. It sucks to have x+2=8 and x+2=-35.4 within the same scope, right? Especially when the code that overwrote x was in a separate file in an edge case condition you didn't consider.

comment 7y ago · link · parent

Yes, I mistyped that bit. I meant to say that because types (as a grammar) are values, they can be inputs and outputs of functions. The functions can fill in the hole that dependent/refinement types fill, by taking context into account (the grammars which describe simple types being context free). Type -> Type fill in for type constructors like this infinite list:

  InfiniteListOf = Type ->
    Type & InfiniteListOf Type
That function just morphs a simple grammar into another grammar. Imagine now if we could calculate something in between:

  IncrementingInfiniteListFrom = number ->
    number & IncrementingInfiniteListFrom number+1
That's where the dependent types come in, naturally.

comment 7y ago · link · parent

I'm feeling both really pissed and validated right now. I thought this was going to just be a normal thoughtless config language that would only be successful as a Google project. Then I looked at the theoretical basis page. I have no formal proof about this, but I've been talking about this type of a type system with my parents and high school CS teacher for a while now! My idea sounds like this: a value is simply an actual binary string. The "type" that classifies any data is described as a formal grammar, where the binary string is a formal language. If the language can parse a given binary value with the formal grammar, that value is an element of the set (type). This naturally leads to a structural type system which can be described using existing set theory and implemented using existing parsers and formal language theory. Of course, this leads to type -> type functions which describe dependent and refinement types naturally. It's great to see this idea being broadcast on the front page here, as I can see it very clearly as a superior type system. I'm really regretting not writing a formal article about it sooner!

comment 7y ago · link · parent

I'm on my phone in the country side with slow internet so I cant look up a link, but if I remember correctly, you should search "Alan Savory TED Talk" on youtube for an introduction to the use of livestock to reclaim land. Essentially, the issue with most livestock grazing is that it does not mimic natural grazing, which is a seasonal, high volume, high density event where the herd moves on and allows the grazed area time to recover.

comment 7y ago · link · parent

While it is only a design concept, Mercury OS [1] might interest you. When I first came across it, I was blown away by the idea. It basically makes the user intent first class rather than the application/program. What I mean is that instead of finding a program or application to execute your intention indirectly, you declare your intent to the OS. Then the OS maps your intent to a series of actions which are executed by hooked-in pseudo-functions. It erases the boundary between applications by being almost like an interactive visual version of a declarative programming language. You should read the article rather than trouble yourself with my explanation though...

[1] “Introducing Mercury OS” by Jason Yuan https://link.medium.com/USD9Pj6svX

comment 7y ago · link · parent

Every once in a while I find a site like yours that has conveniently aggregated a ton of stray thoughts and expands my world a little bit. Just wanted to take a moment to say thanks for doing this

comment 7y ago · link · parent

Great straight forward writing that still sparks interest!

comment 7y ago · link · parent

Implying that said hallucinations, tailored by evolution, are actually a bad thing.

48.

Why You Must Actually Understand The Ω and Y Combinators(medium.com ↗)

5 points · by wlib · 7y ago · discuss

comment 7y ago · link · parent

Environmental problems will only be solved if 1) people can earn money by solving it 2) people hit a breaking point, and actually drop what they're doing to help

...and #2 doesn't seem very likely for a while. So the only practical thing to do right now is spread awareness and to support companies implementing #1. I made a comment here about permaculture which I recommend you see [1]. And I also have an example company implementing #1 [2]. And here's an example of #1 actually happening [3].

[1] https://news.ycombinator.com/item?id=18215706 [2] https://youtu.be/mETzoNau5A8 [3] https://youtu.be/_3KkN8hvUCI

comment 7y ago · link · parent

Exactly. The definition of life that is taught in school and widely cited is very limited to simply what we traditionally consider alive. But where are fr he lines drawn? Must life be conscious, or at least experience qualia? Does conciousness get more "real" in more complex organisms? (Is a fly just as alive as a horse is?) Why do we consider viruses to be not alive? Are our own bodies' cells alive? In what way? The system is very complicated and we answer is with a hand-waving simple definition.

comment 7y ago · link · parent

Thank you for this

comment 7y ago · link · parent

Piping program output is just function composition. The downside is that it works over expensive system processes, and data must be serialized. It's a fragile system where instead of using built-in functions, we use "standard" executables.

comment 7y ago · link · parent

Good insight, thank you

comment 7y ago · link · parent

My point wasn't about python, just an example of how a shell around python, made only for python function calls, would be a useless abstraction.

comment 7y ago · link · parent

A more syntactically friendly Haskell-like language

comment 7y ago · link · parent

That misses my poorly written point. Do you use a separate, awkward tool to call functions you wrote in python? Or do you call the function in python itself? The shell is a useless abstraction that was only necessary in unix because the alternative was c. Now that we have better languages, why not use them to write the OS bottom-up?

comment 7y ago · link · parent

Why did we keep the language of the shell and the OS separate? It seems like a needless abstraction which creates more harm than good (read a shell script vs any other language). While I'm at it, why is the filesystem and syscall api not just part of a standard userland language? For example, the filesystem could be exposed like an object tree rather than some syscall ritual. The syscalls could just be invisible, where the language compiler deals with it instead of the programmer. I think that the old LISP machines got this right while we are stuck in a usless POSIX compatibility trap. The only reason I think they didn't design unix this way was because C was too low level, but we could write the OS in a "higher level" functional language.

comment 7y ago · link · parent

"Invent" comes from Latin and simply means "find". If you think about it, no matter what language, there is no fine line. An invention is just a discovery, but we typically use the word to describe a very specific discovery.

comment 8y ago · link · parent

Yes, I realize that it is obviously Chinese propaganda, but I used it to show that deserts are entirely reversible. You are right that the altitude definitely has a cooling effect, but it also doesn't change the fact that the trees stabilized a desert into a forest.
123