Live data from Hacker News

Coconut: Simple, elegant, Pythonic functional programming

coconut-lang.org

51–60 of 65 posts

Re: Coconut: Simple, elegant, Pythonic functional programming

#51

Earlier quoted context omitted.

Python is an uninspired language with one serious design flaw (significant whitespace) that gained a lot of initial momentum because it was better than Perl. Since then it's accumulated new features in a random thrift store sort of process that has resulted in a fairly complex language. In my opinion this whole generation of slow, dynamic, single threaded languages like Python, Ruby, and PHP only became popular becau…

I'm new to programming, and started a project recently using Python. What other languages you recommend that would be better?

I am not fan of the Python but I recommend you stick to Python for your first steps. It has very good community lots of tutorials, books, etc and lots of packages. It is in general a good language for people that are new to programming. After you master Python you may pick other language.

Re: Coconut: Simple, elegant, Pythonic functional programming

#52
post #5

This is cool stuff, but it's kind of sad that Python doesn't have any of this stuff. Apparently the Pythonic way to do anything is to repeat yourself, type a lot, implement flatten yourself, and cripple lambdas so no one will want to use them. It's a shame, because there's no reason why Python couldn't be an acceptable language for FP, like Julia. It'll never be great at it of course (just like Julia), but good enoug…

You don't look like you would enjoy Go.

Re: Coconut: Simple, elegant, Pythonic functional programming

#53
post #15
post #5

This is cool stuff, but it's kind of sad that Python doesn't have any of this stuff. Apparently the Pythonic way to do anything is to repeat yourself, type a lot, implement flatten yourself, and cripple lambdas so no one will want to use them. It's a shame, because there's no reason why Python couldn't be an acceptable language for FP, like Julia. It'll never be great at it of course (just like Julia), but good enoug…

Can anything really be done by a single-threaded, GIL-laden, dynamic language trying to compete with a modern, natively parallel, JIT-ed language like Julia? That's a bit apples to oranges, no? Once other languages like Go, Swift, Kotlin, Rust and Julia catch-up with Python's range of data science libraries I'd say Python's days are numbered. Python is the Betmax of programming languages and FP is where the shallowne…

I agree with you that Python lacks many useful and advanced features. But that lack of advanced features give it simplicity and because of it much more programmers than for much advanced languages. Many programmers means more packages, more tutorials and bigger community. That is why hard to beat Python, because it's downside (simplicity) give it substantial advantage over more advanced languages.

Re: Coconut: Simple, elegant, Pythonic functional programming

#54
post #40

Earlier quoted context omitted.

This is quite a bit of alarmism without acknowledging somewhat recent facts. Python's parser is being updated to allow for richer grammars, the community has embraced gradual typing, and the project hasn't been very conservative for years now. The withdrawal of Guido as BDFL is quite a step in that direction. Beyond the GIL and the lack of multi-line lambdas, Python is still a pleasant language to start new projects…

I would disagree about it being pleasant, but let's ignore that. What advantages does Python have over Julia? Julia is even simpler than Python at this point, especially for researchers. A lot of non-programmers I know have been switching to Julia, as it's really easy to "write math" in it.

I really want Julia to succeed and take place of Python/R/other. But Python has lots of packages and tutorials/book. You can do lots of things in Python. It will be very hard to replace it because of the need to rewrite lots of things and need to learn other language. Many people do not want to learn new language if current one provides solution for a problem that they are facing today.

Re: Coconut: Simple, elegant, Pythonic functional programming

#55
post #46

Earlier quoted context omitted.

> What advantages does Python have over Julia? You can get paid to write it and there is a mature library ecosystem around it.

Why is the ecosystem important when you can just use pyjulia to call any python library you want? In regards to pay, many Python programmers aren't actually paid to program. And regardless, I wasn't aware that getting paid to program in a language made the actual language itself better.

You will need new programmers to replace old ones if they leave your company. Now instead of knowing only Python they will need to know Julia (which at the moment is not as popular as Python) so it makes much harder to find new programmers. I really want Julia to take Place of Python/R and others but I think it will not happen in near future.

Re: Coconut: Simple, elegant, Pythonic functional programming

#56
post #46

Earlier quoted context omitted.

> What advantages does Python have over Julia? You can get paid to write it and there is a mature library ecosystem around it.

Why is the ecosystem important when you can just use pyjulia to call any python library you want? In regards to pay, many Python programmers aren't actually paid to program. And regardless, I wasn't aware that getting paid to program in a language made the actual language itself better.

> Why is the ecosystem important when you can just use pyjulia

Now you need to package a Julia application and Python application dependencies, instead of just a Python application.

Also, pyjulia is a Julia binding for Python, used for calling Julia code from Python.

The Python bindings for Julia seem to be library specific[1], and brittle. They require an additional special snowflake layer for Python dependencies[2], bypassing PyPI entirely in favor of Conda.

This means that a lot of packages will not work, and even if they do, some will be prone to crashing and some will be out of date.

> And regardless, I wasn't aware that getting paid to program in a language made the actual language itself better.

I like Haskell, I think it is in many ways a great language. However, I'm not going to start new projects in it, nor will I recommend it to clients. It's difficult to hire for, and hard for professionals to justify adopting for reasons other than personal preferences. A big reason for that is that its ecosystem isn't as mature or diverse compared to other languages.

[1] https://github.com/JuliaPy

[2] https://github.com/JuliaPy/Conda.jl

Re: Coconut: Simple, elegant, Pythonic functional programming

#57

Earlier quoted context omitted.

Why is it problematic? I never said or implied that Python should only be used by non-programmers, just that I believe the majority of Python users would call themselves data scientists (or just any kind of scientist I guess) or analysts or traders or accountants or researchers or any other job where writing code is not your job, you just write code to help with your actual job. The point is, of course those people d…

I was trying to be gentle in saying it's wrong. Consider https://insights.stackoverflow.com/survey/2019 . Python is the second most loved language on a survey where the majority of respondents have 'developer' in their title.

but he's saying a different thing.

If there are 10 developers in the world and 5/10 use python, and at the same time there are 100 non-developers-who-code, and 9/10 use python then 95/110 people use python, and most of them are not developers.

I don't know if that is true, but you can't tell it by the SO responses because SO is more popular amongst developers anyway.

EDIT: tho you can see that python is more popular amongst non-devs than amongst devs, as "all respondents" use it at ~42% and devs use it at ~39%.

Re: Coconut: Simple, elegant, Pythonic functional programming

#58
post #15
post #5

This is cool stuff, but it's kind of sad that Python doesn't have any of this stuff. Apparently the Pythonic way to do anything is to repeat yourself, type a lot, implement flatten yourself, and cripple lambdas so no one will want to use them. It's a shame, because there's no reason why Python couldn't be an acceptable language for FP, like Julia. It'll never be great at it of course (just like Julia), but good enoug…

Can anything really be done by a single-threaded, GIL-laden, dynamic language trying to compete with a modern, natively parallel, JIT-ed language like Julia? That's a bit apples to oranges, no? Once other languages like Go, Swift, Kotlin, Rust and Julia catch-up with Python's range of data science libraries I'd say Python's days are numbered. Python is the Betmax of programming languages and FP is where the shallowne…

Natively parallel? From https://docs.julialang.org/en/v1/base/multi-threading/ : "Julia is not yet fully thread-safe. In particular segfaults seem to occur during I/O operations and task switching."

One solution for numerical code at least is to use Numba to JIT-compile (with LLVM, as Julia does) code that can be run without using the GIL, which can be run in parallel on top of Python's threading mechanisms (threading.Thread, concurrent.futures), or with Numba's other options (parallel-for, CUDA kernels, CPU or GPU vectorized Ufuncs/GUfuncs, stencil kernels).

Re: Coconut: Simple, elegant, Pythonic functional programming

#59

Earlier quoted context omitted.

Python is an uninspired language with one serious design flaw (significant whitespace) that gained a lot of initial momentum because it was better than Perl. Since then it's accumulated new features in a random thrift store sort of process that has resulted in a fairly complex language. In my opinion this whole generation of slow, dynamic, single threaded languages like Python, Ruby, and PHP only became popular becau…

How is significant whitespace a design flaw? Have you ever seen a professionally written program in any language where care in formatting did not extend to having whitespace under control? Gofmt comes to mind. Taking this reality that everyone cares about white space and making it a first class citizen is more of a stroke of genius than a design flaw IMHO.

It makes things that are trivial in other languages like copying and pasting chunks of code around or auto formatting code as you type into a very hard problem just to save some delimiters. It looks nice in code samples but sucks in real production codebases.

Re: Coconut: Simple, elegant, Pythonic functional programming

#60

Earlier quoted context omitted.

Python is an uninspired language with one serious design flaw (significant whitespace) that gained a lot of initial momentum because it was better than Perl. Since then it's accumulated new features in a random thrift store sort of process that has resulted in a fairly complex language. In my opinion this whole generation of slow, dynamic, single threaded languages like Python, Ruby, and PHP only became popular becau…

I'm new to programming, and started a project recently using Python. What other languages you recommend that would be better?

I'd recommend JavaScript unless you want to do something that python is specifically good for like machine learning. JavaScript has its own issues but it's not hard to learn and is used everywhere.
Post reply on HN