Live data from Hacker News

Why programming languages matter [video]

youtube.com

91–100 of 129 posts

Re: Why programming languages matter [video]

#91
post #47
post #34

Earlier quoted context omitted.

> nobody seems to have identified what functional programming is defined as Nobody asked (until now, so thank you for asking!), and this is a fairly well discussed topic for anyone who cares to search! You will probably get a lot of slightly different answers depending on who you ask or where you look, but I think a very strong common thread is "referential transparency". Functional programming gives you that, and th…

> Referential transparency is related to the concept of "function purity" (in the sense that either one usually guarantees the other), which you will often hear people talk about as well. Isn't referential transparency (the property of a function that allows it to be replaced by its equivalent output) a consequence of function purity? In other words: could a pure function not be referentially transparent? Also, I rem…

"Could a pure function not be referentially transparent?"

Yes there are pure functions which are not referentially transparent. A pure function with side effects, such as printing a result to standard output, is not referentially transparent. You can't replace the function with it's return value, since that doesn't replicate the printing side effect.

Re: Why programming languages matter [video]

#92

Earlier quoted context omitted.

I support abandoning dynamic typing.

Same. The dynamic typing helps with prototyping but all MBAs have consistently proven they are NOT willing to have the prototype rewritten in something better later.

I found that it is better to ask for forgiveness than permission.

Re: Why programming languages matter [video]

#93

Earlier quoted context omitted.

Same. The dynamic typing helps with prototyping but all MBAs have consistently proven they are NOT willing to have the prototype rewritten in something better later.

I found that it is better to ask for forgiveness than permission.

Same, by the way. I am ashamed that I didn't do it more often over the course of a 22-year long career. I really should change that.

Re: Why programming languages matter [video]

#94

Earlier quoted context omitted.

I wouldn't say it's trivial but yes it's there and it's very helpful.

There are many cases where you can replace a call to `.iter()` in your Rust code to a call to `.par_iter()` from `rayon`. Those cases are trivial, and it's great.

Yes, that one I like a lot.

Re: Why programming languages matter [video]

#95
post #78

Earlier quoted context omitted.

It’s simply a reflection of the immaturity and terribleness of the state of the art in programming languages. People eventually got around to things like restricting bytes to be eight bits, using a standard character set, and so on. Eventually we will find some language factors that “stick” (e.g. abandon the stupid distinction between statements and expressions) which will become baseline and the space of variation w…

Yeah, your comment is likely the answer. I am just bitter why is all that happening so darned slow. I really hoped that 22 years in my career I would've seen certain problems disappear forever (as in, be solved, formalized, nailed, and never ever discussed again). But alas, nope.

the idea that a byte was 8 bits and not some dynamic length bitstream took at least 20 years, so don't get too excited.

So many ideas from Lisp have slowly become mainstream (lambdas, closures, GC, interpreters with dynamic typing, languages both interpreted and compiled...) that I feel like any convergence is far off.

Re: Why programming languages matter [video]

#96

Earlier quoted context omitted.

If anything, in my eyes it's exactly because programming languages matter is the reason why we should have less of them. We should start folding some languages inside others. (Or abandon them.) As a counterpoint, the programming industry is vast, so the opportunity cost of using tools that are not as good as they could be is also very high. If we don’t continue to explore new possibilities, how will we make those too…

As a counter-counter point, I hear your sentiment a lot, I work for 22 years in the profession now -- and I am a fairly average programmer so I don't claim any credentials or anything. ...And I've never seen your sentiment work. Nobody is really learning anything, people just want to tinker with stuff and never read history or even best practices. All I see are people going in circles forever. Maybe there's a smaller…

It’s easy to become disheartened, particularly in the world of web development. It looks like we’ve been around the industry for a similar amount of time, and I agree that the amount of wheel-reinventing in web development is shockingly bad for a part of the industry with so many resources poured into it by now. But have faith, my friend! Even in frontend web work, good ideas do break through from time to time. :-)

Not so long ago, there were plenty of FE people who would argue to the end of time that JavaScript was fine and building ever larger frontend applications wouldn’t benefit from static types that just take more work to write. Today, it seems TypeScript has almost entirely displaced JavaScript for that kind of work.

Not so long ago, we were trying to build those web frontends by manually tracking state implicit in HTML form elements and maybe doing a bit of automatic binding. Then React came along, the frontend world finally realised that immediate mode is a thing, and today building web UIs in a more declarative style from some kind of components is common to almost all of the popular libraries and frameworks.

Each of those changes must have saved millions of hours of developer effort already compared to how we did things before, as well as avoiding countless bugs. Now imagine what we could do if, just as a thought experiment, we could all use a language for frontend web work that didn’t have the legacy baggage that TS/JS have, did have a much more comprehensive and well-designed standard library, and provided better control over side effects and by extension safer and more readable code for all the interactions with remote APIs and state management and interactive DOM elements that modern web apps do all the time. I don’t know where such a language might come from today, but if we can shift such a large part of the industry to TypeScript and declarative/component-based rendering within a few years, it doesn’t seem an impossible dream.

Re: Why programming languages matter [video]

#97
post #19

Earlier quoted context omitted.

"FP" camps tend to come in two flavors: "I'm a mathematician writing a computer program, and all problems will be made to look like math problems even if it means the program becomes an inscrutable mess of types and dense syntax" and "functional-ish idioms are included". The latter is useful, sometimes, for cloud computing and parallel computation; the former tends to have too many problems (slow build, slow executio…

Interesting. Functional programming is the only strategy I've seen be successful at building business software. (Hint: you can do FP in Java and it's not even awkward, and SQL is inherently functional).

I work at a FAANG-like company. The code base has almost no functional programming paradigms deployed. It’s a multi-billion dollar company from which I, an IC cog in the machine employee, became a multimillionaire through from the IPO. It’s wildly successful.

Re: Why programming languages matter [video]

#98
post #19

Earlier quoted context omitted.

"FP" camps tend to come in two flavors: "I'm a mathematician writing a computer program, and all problems will be made to look like math problems even if it means the program becomes an inscrutable mess of types and dense syntax" and "functional-ish idioms are included". The latter is useful, sometimes, for cloud computing and parallel computation; the former tends to have too many problems (slow build, slow executio…

Interesting. Functional programming is the only strategy I've seen be successful at building business software. (Hint: you can do FP in Java and it's not even awkward, and SQL is inherently functional).

[deleted]

Re: Why programming languages matter [video]

#99
post #47

Earlier quoted context omitted.

> Referential transparency is related to the concept of "function purity" (in the sense that either one usually guarantees the other), which you will often hear people talk about as well. Isn't referential transparency (the property of a function that allows it to be replaced by its equivalent output) a consequence of function purity? In other words: could a pure function not be referentially transparent? Also, I rem…

"Could a pure function not be referentially transparent?" Yes there are pure functions which are not referentially transparent. A pure function with side effects, such as printing a result to standard output, is not referentially transparent. You can't replace the function with it's return value, since that doesn't replicate the printing side effect.

I thought that a pure function could not have side effects by definition. Would you mind sharing your definition of a pure function?

Re: Why programming languages matter [video]

#100
post #95

Earlier quoted context omitted.

Yeah, your comment is likely the answer. I am just bitter why is all that happening so darned slow. I really hoped that 22 years in my career I would've seen certain problems disappear forever (as in, be solved, formalized, nailed, and never ever discussed again). But alas, nope.

the idea that a byte was 8 bits and not some dynamic length bitstream took at least 20 years, so don't get too excited. So many ideas from Lisp have slowly become mainstream (lambdas, closures, GC, interpreters with dynamic typing, languages both interpreted and compiled...) that I feel like any convergence is far off.

repl based development, or until people see how cool structural editing really is
Post reply on HN