Live data from Hacker News

GoPlus – The Go+ language for data science

github.com

31–40 of 64 posts

Re: GoPlus – The Go+ language for data science

#31

Earlier quoted context omitted.

Agreed, but it might be useful for a full stack data scientist that is forced to work in a Go systems environment. That's why Python+PyData has had so much success. There are packages to support data science, but the language itself can also be used to implement a system, so integration is rather seamless. That's not true for, say, R.

I use Python and R for data science, and I've never had any issue with R. In fact, I find that many tasks are much simpler in R than in Python.

I am referring to using R to build systems. It's not common.

Re: GoPlus – The Go+ language for data science

#32
post #25

Earlier quoted context omitted.

> I'm surprised comprehensions in particular haven't spread to more modern languages. I've come to dislike list comprehensions. Simple ones are ok but they do not handle incremental complexity well. Invariably it means code slowly becomes really unreadable as time goes by because nobody wants to rewrite the list comprehension when one more little tweak stuffed in there will do the job. I much prefer object-functional…

Yes, as a dev who started in Python and has done more JS recently, I’ve really come to believe that the chaining of in-line functions is a better approach in the end. Python theoretically has the advantage of working with lists or iterators, but in practice, all you really use are lists.

To be fair many tools use iterator types that are not lists like Django querysets.

I feel the nice thing in Python is generator expressions, so for lots of code you can decrease the memory footprint and speed some code up through easy lazy evaluation.

I do appreciate the clarity of function chaining, and I think Rust made particularly good decisions around iteration in that way.

Function chaining ideally needs good ways to break iteration, skip and things, and JS isn't very feature rich beyond the basic map, reduce, forEach. It feels very incomplete compared to a lot of languages that offer that stuff. Hence the popularity of underscore and then lodash.

Re: GoPlus – The Go+ language for data science

#33

Earlier quoted context omitted.

I use Python and R for data science, and I've never had any issue with R. In fact, I find that many tasks are much simpler in R than in Python.

I am referring to using R to build systems. It's not common.

What would you consider a system? Python definitely has more market share than R, but there's still name brand companies of various sizes that use an R stack for data science.

RStudio lists dozens of example clients here: https://rstudio.com/about/customer-stories/.

Use cases include collaborative model development, EDA tools, dashboarding, printed report generation (PDFs and HTML), public facing websites, etc.

Re: GoPlus – The Go+ language for data science

#34
post #28

Can we try our best to not fork languages? Someone in 8 years is going to have to refactor a bunch of this GoPlus code to be compatible the Go2 or Go3 and it’s going to suck. We already have Python and Scala

You're barking up the wrong tree.

Re: GoPlus – The Go+ language for data science

#35
post #25

IMHO these conveniences should just be in the language. List comprehensions, dictionary comprehensions, and short-hand for literals are the kind of syntactic sugar that have almost no downsides, save you some RSI, and make code more readable. I'm surprised comprehensions in particular haven't spread to more modern languages.

> I'm surprised comprehensions in particular haven't spread to more modern languages. I've come to dislike list comprehensions. Simple ones are ok but they do not handle incremental complexity well. Invariably it means code slowly becomes really unreadable as time goes by because nobody wants to rewrite the list comprehension when one more little tweak stuffed in there will do the job. I much prefer object-functional…

This is only delightful when you are doing synchronous computation or you have async/await in the language. Until Loom is available, using this same pattern with CompletableFuture breaks in the face of try-with-resources.

Also I don't think it's possible in Python using await since await is a prefix keyword so in your example .groupBy is not a method on Future so it won't work.

I love ReactiveX as much as anyone but these issues cheese me off.

Rust has await as a postfix operator so this pattern works flawlessly when mixing async and sync code.

Re: GoPlus – The Go+ language for data science

#37
post #11
post #4

I'm not a Go user, but is the important idea here that it can be run from a scriptingish environment like Jupyter or something?

It's significant syntactic sugar that brings it closer to Python, but no notebook support from what I can see. Do any notebooks support a compiled language?

R notebooks support a bunch. I count about 41 languages in my install, including Go, C++, Fortran and Julia, as well as Python, SQL, Bash, etc.

Re: GoPlus – The Go+ language for data science

#38

I love the idea of main-less Go scripts for times where you just want to do something simple, fast. Neugram [1] aimed to make Go a better scripting tool, but unfortunately it seems the project is dead. Although Go+ says its focus is on data science, I think it could fill this niche too. By the way: does Go+ have shebang support? 1: https://github.com/neugram/ng

> I love the idea of main-less Go scripts for times where you just want to do something simple, fast.

What do you mean by a main-less script? And what would be "simple and fast" about it? If I want to try out something fast, I just do everything in a main.go and run it with "go run main.go", and that works well as a scripting language.

Re: GoPlus – The Go+ language for data science

#39
post #25

IMHO these conveniences should just be in the language. List comprehensions, dictionary comprehensions, and short-hand for literals are the kind of syntactic sugar that have almost no downsides, save you some RSI, and make code more readable. I'm surprised comprehensions in particular haven't spread to more modern languages.

> I'm surprised comprehensions in particular haven't spread to more modern languages. I've come to dislike list comprehensions. Simple ones are ok but they do not handle incremental complexity well. Invariably it means code slowly becomes really unreadable as time goes by because nobody wants to rewrite the list comprehension when one more little tweak stuffed in there will do the job. I much prefer object-functional…

This assumes some_giant_list is an object that has "findAll", that "findAll" returns and object that has "groupBy", which returns an object that has "countBy".

Looking at that code, I don't even know what the intermediary objects are, but given the names of the operations, they can't be all flat lists.

Besides, you may not put your list comprehension inline. It is often more readable to make it span on several lines, espacially if it's a complex one:

    banned_ip = {
        con.ip 
        for con in connexions 
        if con.ip in blacklist
           or 
           con.type == "internal"
    }

Re: GoPlus – The Go+ language for data science

#40
post #25

Earlier quoted context omitted.

> I'm surprised comprehensions in particular haven't spread to more modern languages. I've come to dislike list comprehensions. Simple ones are ok but they do not handle incremental complexity well. Invariably it means code slowly becomes really unreadable as time goes by because nobody wants to rewrite the list comprehension when one more little tweak stuffed in there will do the job. I much prefer object-functional…

Yes, as a dev who started in Python and has done more JS recently, I’ve really come to believe that the chaining of in-line functions is a better approach in the end. Python theoretically has the advantage of working with lists or iterators, but in practice, all you really use are lists.

> all you really use are lists.

The more you get experience in Python, and the less you use specifically lists.

In fact, you can spot people getting confortable with the language when they start importing itertools, unless they are data scientists, of course.

Post reply on HN