Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions

Submissions

comment 10y ago · link · parent

Addition, as implemented by Python, is functional. There are no side effects. A fully imperative encoding of addition would be eg. the x86 add instructions. John Backus gave us "functional" arithmetic with Fortran, but realised all values should should be treated this way, not just numbers. I take your point about the iterators being mutated and the loss referential transparency. That's certainly not functional programming.

comment 10y ago · link · parent

There is no well defined definition of functional programming. Since almost every mainstream imperative language supports higher-order functions, I would suggest that criteria is inadequate. A better definition is programming without side-effects.

comment 10y ago · link · parent

You seem to be confusing interface and implementation. Lazy lists and for comprehensions appeared in functional programming languages first; and that Python code looks to have borrowed them.

comment 10y ago · link · parent

The paper "A Correspondence between Continuation Passing Style and Static Single Assignment" by Kelsey, suggests SSA has a lot more in common with functional programming than you seem to believe it has.

comment 10y ago · link · parent

Like Appel, I wasn't entirely serious about it being a "functional language", but I think the point still stands, it is a major step towards a more mathematical program representation ("variables" instead of "assignables"). And just like "functional programming", the primary goal is ease of reasoning.

CPS is typically used to handle imperative control structures by impure functional programming languages, so it should indeed be of interest to imperative compiler authors.

comment 10y ago · link · parent

Excellent point!

comment 10y ago · link · parent

C/C++ is not a good choice for writing a compiler. I do not know of any modern functional language compiler that is written in C/C++. But what does this have to do with SSA?

comment 10y ago · link · parent

That's just one advantage of many. Without SSA, you can't even constant fold without doing dataflow analysis. So I would say the structure is very important, that's why everyone is using it now.

comment 10y ago · link · parent

This paper discusses going from SSA to ANF: http://tinyurl.com/j25xy5t

comment 10y ago · link · parent

There is no rigorous definition of functional programming. But SSA is trying to achieve similar goals. Google the paper "SSA is functional programming" by Andrew Appel if you want to know more.

comment 10y ago · link · parent

I find it somewhat ironic that most mainstream compilers now transform imperative code into a functional language in order to reason about the code.

comment 10y ago · link · parent

Does this also count? It's approx 50 lines: http://tinyurl.com/oofj8mz

comment 10y ago · link · parent

That's great that it works for you. But for Skylake hardware, Displayport MST is completely broken and Intel have no plans to fix. The major players simply are not heavily investing in desktop linux, leaving the community to try and fill the gaps.

comment 10y ago · link · parent

I would suggest not trying to source quality hardware from an electronics store. For software development, Thinkpads more then compete with MacBooks, the keyboard is considerably better too.

comment 10y ago · link · parent

It's not possible to implement fork efficiently on Win32/64 which cygwin uses, but are you sure this is the case when using the NT native APIs?

comment 10y ago · link · parent

Completely agree. To add another example, Displayport MST on Linux is completely broken on Skylake and Intel have no plan to fix.

comment 10y ago · link · parent

I like the quote :)

comment 10y ago · link · parent

I didn't mean to imply you had said it was the last word. The form of OOP that I would be interested in would probably use row polymorphism instead of subtyping. It might indeed be possible to encode this in DOT.

comment 10y ago · link · parent

   it's just the only currently known way where
   both modular and functional sides are actually 
   useful without introducing completely separate
   sub-languages.
This isn't true anymore and 1ML was my counterexample. I sympathise with your point that Scala is a working shipping product.

comment 10y ago · link · parent

The "path forward" is purely a socioeconomic one and quite unrelated to any technical argument.

comment 10y ago · link · parent

He is comparing Scala to OCaml, whose module system dates back to 1995, not any current research. My point was that Scala is not the only way to do first-class modules. Subtyping is my biggest issue with Scala and he admits that (variance) is "hard to get your head around" in that talk. 1ML is a research project, which probably would get a lot more funding if it talked about "objects" and "classes".

comment 10y ago · link · parent

What talks are you referring to? Can you tell me what I have written that you disagree with? The first 1ML paper was last year, that's not "old" relative to Scala, which first appeared in 2004.

comment 10y ago · link · parent

The criteria of success for me is simplicity and generality. The part of OOP I am interested in is first-class modules, being able to package up types and functions acting on those types into records. Dotty is not the core of the current version of Scala. It does look interesting, but personally I would prefer an approach that does not use subtyping. My point is only that Scala does not represent the last word in FP+OOP.

comment 10y ago · link · parent

Much of Scalas complexity comes from trying to encode ML features using subtyping and class-based OO. So I think the jury is still out on whether Scala represents a successful marriage. There are other ways to add first-class modules (objects) to ML, the most interesting is probably the new "1ML" paper. Personally I would rather have OOP encoded in a functional language and not the other way around. This would avoid many of Scala's warts such as a nominal core (e.g. Function1-22), methods not first-class, pattern matches that runtime cast etc.

comment 10y ago · link · parent

The flip side to this is that is doesn't look/behave alien when you change platform.

comment 10y ago · link · parent

In my opinion a huge strategic error not to write a cross-platform app. Now they have two separate code bases (Mac and Windows) and still no Linux support ever likely. Since I use Linux, like many other developers, this app isn't an option.

comment 10y ago · link · parent

Add to that thin power cables that fray easily. A poor keyboard (relative to my thinkpad). Glued-in internal battery. Heavy (relative to plastic/composites) aluminium case that dents easily and attenuates wifi. Glossy glass screen that cracks easily and is far too reflective. The trackpad is good for scrolling but right-click is too awkward. The whole design philosophy is form over function.

comment 10y ago · link · parent

Mirage uses OCaml's strong types to generate secure, fast and highly specialised code. It's also very succinct and with LWT, almost as good as Haskell for lightweight concurrency and nonblocking IO. Why would you want to use Python? This is a golden opportunity to learn and use a superior language.

comment 10y ago · link · parent

NodeOS, like most projects, is likely just a duct-taped jenga tower of the usual suspects. The attack surface will be huge. For example, OpenSSL will be in there with all of its gotos and malloc-reinventions. From a security point of view, I don't see a contest. The Mirage guys even clean-room implemented SSL in OCaml. This is no ordinary OSS project.

comment 10y ago · link · parent

What's next PythonOS, RubyOS? Just learn OCaml, its really not that hard.
1
6566676869