Is Go good choice for porting graph based app?

348 views
Skip to first unread message

Kamil Ziemian

unread,
Feb 3, 2022, 5:26:14 PM2/3/22
to golang-nuts
Hello,

I was handed proof-of-concept app written in Python. It seems underdeveloped, buggy and running it first time is a pain, because of dependencies. Basically it need to read some graphs stored in JSON files and manipulated them accordingly and write them to JSON files again.

It seems that porting it now to more suitable language is worth a gain at this stage and I wonder if Go is a good choice? I read and watch many Ian Lance Taylor presentations about generics, so I know that only that generic graph (tree) data structure is something that can be a pain,  but in this case it would be were small issue. It seems that we have only few data types to be stored in graph, mostly strings and ints.

I'm not true gopher, so I don't know if Go is proper choice for this task. I don't believe that Python is any better, but maybe I should check another language.

Also, if someone know better thing to sore graphs than JSON, I would appreciate it any suggestion.

I don't write anymore about this app, since I don't know if company allows for it.

Best regards,
Kamil

Dan Kortschak

unread,
Feb 3, 2022, 8:16:28 PM2/3/22
to golan...@googlegroups.com
I have had success writing graph handling code in Go. The answer to
your question though lies in the details of what it is that you want to
do.


Kamil Ziemian

unread,
Feb 4, 2022, 6:35:30 AM2/4/22
to golang-nuts
Are you code available somewhere on Internet? Looking at some graph handling code in Go would be very helpful to me.

I have a very little time today, maybe I will write more about it in future.

Best,
Kamil

Sebastien Binet

unread,
Feb 4, 2022, 7:08:32 AM2/4/22
to Kamil Ziemian, golang-nuts
On Fri Feb 4, 2022 at 12:35 CET, Kamil Ziemian wrote:
> Are you code available somewhere on Internet? Looking at some graph
> handling code in Go would be very helpful to me.

it's over there:

- https://pkg.go.dev/gonum.org/v1/gonum/graph
- https://pkg.go.dev/gonum.org/v1/gonum/graph/...

hth,
-s

drv drv

unread,
Feb 5, 2022, 10:43:46 AM2/5/22
to golang-nuts
I don't know the background of this Python code but " It seems underdeveloped, buggy and running it first time is a pain, because of dependencies. " is not a language problem.
I cannot imagine any dependencies in this kind of program.
JSON "equals" dictionaries in case of Python and it supports natively so it is quite fast and can be write very simple and elegant code.
It is true that GO is faster (in this case I guess 2x on single core) but if you cannot take advance of goroutines (and multicore) use Python.

Kamil Ziemian

unread,
Feb 6, 2022, 6:15:25 AM2/6/22
to golang-nuts
Thank you Sebastian Binet, I need to check more gonum project.

You are right drv drv that Python is not true culprit here. Problem is that it seems a bad written code. Maybe after a while I will change my mind about it, but it looks bad right now.

Here you have list of dependencies that came with this code.
attrs==21.2.0
azure-functions==1.7.2
certifi==2021.5.30
charset-normalizer==2.0.4
graphviz==0.18
idna==3.2
jmespath==0.10.0
jsonschema==4.1.2
Pillow==8.4.0
pyrsistent==0.18.0
raven==6.10.0
requests==2.26.0
svg.path==4.1
urllib3==1.26.6

I have a bunch of problem with it. I normal use Python 3.6, because it is standard Python on Ubuntu OS and I'm fine with that. But, jsonschema v. 4.1.2 wasn't available on Python 3.6. After installing new version of Python I now have a problem with Pillow. I still don't know what to do with that, so they told me to switch to Windows. And I just begin with it.

Best,
Kamil

Mike Schinkel

unread,
Feb 6, 2022, 7:19:44 PM2/6/22
to golang-nuts
Kamil,

Are the JSON files using a set schema, or could they be any arbitrary schema? 

Not that the latter can't be handled by Go, but IMO Go excels at the former because of ability to statically type.

-Mike

Kamil Ziemian

unread,
Feb 20, 2022, 3:43:10 PM2/20/22
to golang-nuts
I think they use a set schema, but I need to check. To be honest, I have a lot to do on my own now and people from this graph app are acting as they were wanting to sabotage my work. I think that they just clueless about consequences of their actions.

As a result I know, I currently try to kick this graph can down the road.

Best,
Kamil

Kamil Ziemian

unread,
Feb 20, 2022, 3:44:55 PM2/20/22
to golang-nuts
"As a result I know, I currently try to kick this graph can down the road." Stupid me. It should be "As a result I currently kicking this graph can down the road.", only written in better English than mine.

Best,
Kamil
Reply all
Reply to author
Forward
0 new messages