I'm not sure how to continue my programming journey, so I'm asking here:

I've only ever used Python, and I love it, except when it's slow (which is *always* when you're interested in writing very efficient graph algorithms like I am).

I like simple, clean code, I've mostly never used objects or classes, they're not particularly useful for what I'm doing.

So, after some research, I am thinking about learning C or Go. The thing is, C is much more widely used and supported, but I don't want to become a hardcore developer who has to manage memory and shit. I want to be a mathematician who can write good code, that's all.

Also, I like that Go makes concurrency easier, at least that's what I've read, which is something I'll need to use a LOT because of the particular algos I have in mind.

What do you guys recommend? cc nostr:npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku

Reply to this note

Please Login to reply.

Discussion

In a choice between C or Go I recommend Rust

lol. why?

Because that is where it sits. It is as perfomant and capable as c but safer than go. For distributed and secure systems it is probably the "right" language.

"safer"

what is safer about a language that has macros and the ability to tamper with memory directly versus another that has a lot of obstacles to doing this kind of tampering?

the only difference in memory safety between the two languages is you can get a performance problem in Go if you just fling out a bazillion new buffers for no reason, use them once and then forget about them... and then you need to consider a freelist

there is no buffer overflow vulnerability in valid code in either language

i tell you what the safety problem with rust is

the protocol has to be designed to be secure, most vulns these days are protocol level not buffer overflow

so, Rust is fixing a problem from 20 years ago with an overly complex syntax that really is just hints for a really dumb GC, and go has a sophisticated, 15 year old GC that builds upon its own experience and that of Java's GCs and other GC using languages

this "safety" thing is illusory

what's unsafe is hard to read code, and complex syntax and the red flag is that it takes 100 times longer to compile it

Ok fine, good points all. But it is safer in that I don't have to tell my friends that I program in go. I use rust, I don't have any friends.

what has programming got to do with your social life exactly?

how does this in any way have anything to do with the best choice for writing simulators for a mathematician who is not greatly experienced with programming?

most mathematicians and similar pick python because of its simplicity

Go is simple also, but if you are doing large graph calculations like WoT then it's also 10x faster

safety has nothing to do with his question, nor does your social standing with your hipster mates

Sorry, that was me admitting I was wrong and throwing in some self-deprication.

I found it funny 🀣

that's because you are a hipster

Who hurt you?

i have used go to write complex dynamic adjustment algorithms that do EMAs and suchlike over prescribed time windows of data, structs are quite memory efficient and can map graphs quite nicely... the default normal size of array indexes is 32 bits so you can use them in place of 64 bit pointers in data structures, and quite efficiently represent lookup tables between longer values and these serial values

to do really big stuff you have to go with pointers but if you are gonna have under 4bln nodes in your graph you can do it more efficiently with arrays

i'm pretty sure this is along the lines of how 3d rasterizing mesh graphs are represented in memory, i know for sure that 32 bit integers are the main thing you deal in on a GPU (they only have 32 bit integer dividers, for example)

i'd say for the most part, 32 bit array indexes for nodes and 32 bit floating points are gonna be plenty of precision for your algorithms and it's really easy to do this in Go

also, just to explain something, arrays in go are like structs, they are constructed the same way as C but the dynamic sizing stuff is taken care of automatically for you, though if you really have a lot of growth in arrays you save a lot of time shuffling memory by over-allocating compared to the default (which is a doubling cycle iirc)

If you want something high performance but don't want to go low level, I can't recommend julia enough.

Syntax is clean, JIT compiles, multi processing/threading is simple. You can even use Python libraries for anything that isn't implemented in Julia - meaning after doing anything requiring performance you can use Sklearn for extra analysis and matplotlib for plotting. Deep learning and autodiff libraries, while not fully fledged out as Python's ecosystem is 🀌

Decent learning curve especially when coming from Python

depends what you want to code. think about what you want to create / work on then narrow down your list.

R

Have you considered Haskell or other functional languages? Haskell is often the favorite of Math-ier minds.

not yet. I've used Mathematica, it was cool but the fact that it's proprietary it's a super no for me.

Try Haskell! "Learn you a haskell for great good" is the oft-recommended source. I have a copy, DM if you want it

yes pls!

This link is only valid for 24 hours btw. Let me know if it expires before you get it

Go fits best to your profile "mathematician that can code".

You can learn it fast, and its a powerful and safe language.

C has way more gotchas and its much more tedious to write larger applications in it than Go. Great for understanding how computers work but wouldn't recommend it for your use case.

I enjoy Rust most, it's package manager is great, there are tons of useful libraries and you can develop quality stuff in a very reasonable pace. But the learning curve is steeper than Go, not sure if you have the motivation/need for it.

learning curve for a 4 year experienced Go programmer on Rust was nearly 2 months until i sorta almost understood lifecycle annotatations, and was able to write a servicable microservice for gRPC/Protobuf

on Go, concurrently, i was writing a tutorial how to do the same thing and it would take you a weekend to go through it really thoroughly and be able to instantly adapt it to any data architecture you had in mind

send the tutorial when I have pls

I've been programming in Go for about 7 years and have come to appreciate it's simplicity and speed. I call it baby C because it's almost as powerful but a lot more expressive and easier to use. Rust is a dumpster fire designed by eggheads and l33t hipsters who think they are solving the problem of poorly written code by beginners but have just made the problem worse with their assumptions.

You can either learn it yourself or trust the language to do it for you. It's only tradeoffs. I'm a C engineer because I want control, it's that simple.

let me just put it this way:

when i was 12 years old, i got to do a stint of some kind of work experience at the Department of Primary Industries, in my home town of Toowoomba

i was being supervised by a guy who wrote simulators for crops that models rainfall, genetics, etc... his main go-to language was Forth

if you know Forth, it's like one step away from Assembler

in my time there i learned a bit about C and Lisp, lisp was very cool, but for doing math, the C and Forth were the best options back then (1988)

it's not that i'm some kind of a fanatic about the language i prefer, it's literally really easy for doing this kind of work, easy syntax, you will probably grasp it mostly straight away, and everything as regards to mathematics is very explicit, though if you need to do work with sets, you have to write your own stuff, and scaling it up gets complicated because of thread safety with maps, and the last point is not only simple, but fast

Uh sounds kind of silly, but also maybe consider building a team if possible? Then get crack smoking engineers like myself to do it for you?? Less time implementing and more time designing? That's how nostr:npub1m3xdppkd0njmrqe2ma8a6ys39zvgp5k8u22mev8xsnqp4nh80srqhqa5sf tricked us XD

why silly?

Not everyone wants to depend on others nor want a to work with a team etc. The idea of me telling you to "just get a team that will work with you for no money on your projects" is a bit laughable on the outside is all.

I make no claims to trickery! nostr:nprofile1qqs06gywary09qmcp2249ztwfq3ue8wxhl2yyp3c39thzp55plvj0sgprdmhxue69uhhg6r9vehhyetnwshxummnw3erztnrdakj7qguwaehxw309a6xsetrd96xzer9dshxummnw3erztnrdakj7qgcwaehxw309ahx7um5wgh8xmmkvf5hgtngdaehgtcw45ql5 on the other hand... 🀣

little update;

- C is nice but not for the faint of heart

- C++ I found it to be C with added garbage that one has to learn not to mess up memory

- Go is beautiful, thanks nostr:npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku for letting me discover it

I am following https://quii.gitbook.io/learn-go-with-tests and fucking hell, finally a guide for noobs that explain to me how I should work and think when I program, how I should do tests and so on.

nostr:note1jvr0e5vk2386r3ne3kwme7vms7lkewvzn8vhh0qjk9qsgx4d834qf9l78p

Good luck on your journey, but know that you will have artificial intelligence both as an ally and a rival, as it is constantly improving and creating complex code, which is reducing the market for many programmers. I also program in Python, and I had to reinvent myself and use tools to my advantage. I confess that at first, I was reluctant because I prefer the traditional method of doing things. However, in a market that increasingly seeks speed in everything, I ended up expanding my knowledge to other areas, including low-code and no-code platforms. There, we can do a lot of things relatively quickly, take the code, edit a few things, improve it, and some platforms even include AI. So how much time do we gain using this? The future is heading in this direction, so we must adapt.

yes, πŸ’―

However I would say that my value add is in the math and the design of the algorithms, something that I think is AI-safe for the time being.

I just want to be able to write them in a simple yet fast way.

If I had to pick a next language to learn, it’d be Elixir.

Concurrency and fault-tolerance are built into the language. It is built on top of the Erlang VM which was specifically designed to handle concurrent workloads at scale.

hey stel, thanks for the suggestion!

I never heard about it