Readit News logoReadit News
rami3l commented on Zig: What to Expect from Release Month   ziglang.org/news/what-to-... · Posted by u/enz
tomrod · 8 months ago
Cool to see!

I'm interested in learning a lower level language a bit better. I've spent some time in Rust and C (not enough to be proficient) -- is Zig a good candidate? It seems to have a lot of interest, I'm curious about objective views on its long term progress and forecast.

rami3l · 8 months ago
I've been playing around with Zig as a potential C alternative in my stack, and I think that it's pretty good at least for toy/learning projects actually. I especially like the way `comptime` gives me superpowers.

Before Rust and Zig, I thought I disliked systems programming, while as it turned out, I mostly just disliked C.

However, when it comes to actively maintaining a serious project you do need to take extra care, since using a pre-v1 language does require a lot more efforts, since even in a post-v1 language you need to handle lib updates and such...

Also, even though I believe I'm no longer afraid of manual memory management, explicit allocators, etc. for writing regular userland applications, I still think Zig can be too low-level for certain problem domains from time to time (the same thing for C, and I believe Zig is there specifically to target C programmers), so it's really about finding out which tools would be a great fit for you in which scenarios.

rami3l commented on A Developer's Review of a Snapdragon X Laptop   wezm.net/v2/posts/2024/yo... · Posted by u/wezm
wezm · a year ago
Thanks for the pointer to the aarch64 build of rustup. Are there plans to update this bit of the website to point at that version in the future? https://files.wezm.net/forums/Screenshot%202024-07-16%20at%2...
rami3l · a year ago
The site's source code is already updated, but unfortunately the website itself is refreshed per Rustup release, so we might have to wait for a bit longer...
rami3l commented on A Developer's Review of a Snapdragon X Laptop   wezm.net/v2/posts/2024/yo... · Posted by u/wezm
rami3l · a year ago
Thanks for sharing the experience! At Rustup we're also getting ARM64 Windows-related requests recently, so I'm very curious about how well these machines actually do as a daily dev workstation. Looks like your Yoga 7x performs even better than I thought it would!

I'd like to add that actually there is an official prebuilt Rustup binary available for you at https://win.rustup.rs/aarch64, maybe that will lead to less translation overhead for your Rust workflow :)

rami3l commented on Arm64 on GitHub Actions   github.blog/2024-06-03-ar... · Posted by u/sonichigo
qwertox · a year ago
I had an issue where a Rust application, which I had compiled on a Radxa ROCK 5B, would nor run on a Raspberry Pi 4; I had to compile it again for it. Both were running Ubuntu 22.04, 64 bit.

Why would that be and how would this affect these Arm64 compiles on GitHub?

If you compile a normal application for amd64, it will work on any 64 bit Intel and AMD machine, unless you start using specialized features, which wasn't the case in the above mentioned case.

rami3l · a year ago
This reminds me of one issue that I've encountered at Rustup. Early versions of ARM64 Pi OS actually use a 32-bit userland. As a result, this has caused user complaints since our installer sees a 64-bit kernel and will happily download a 64-bit binary (which will then refuse to run): https://github.com/rust-lang/rustup/issues/3307#issuecomment...
rami3l commented on Show HN: Getada: rustup-like installer for Ada's toolchain/package manager   getada.dev... · Posted by u/ajdude
rami3l · a year ago
As a current Rustup maintainer with a bit of Ada background I gotta say: nice work!

I do feel Ada as a language is way ahead of its time, but when I was learning it (a while before the first Alire release) I was also puzzled by dev environment setup. I guess the Rust experience has shown the importance of a friendly onboarding experience, so I’m very glad to see Ada is going this direction as well with Alire and now Getada :)

rami3l commented on Think Python, 3rd Edition   allendowney.github.io/Thi... · Posted by u/beefman
rami3l · 2 years ago
Many thanks for this book! Think Python 2nd is the first book I've ever read in order to teach myself programming.

Now I've come a long way to become an actual developer shipping real products and have certainly learned a whole lot more on the topic, but I still think the first steps are the most important/difficult ones. Although I've moved away from Python towards other platforms such as Rust, the basic concepts covered in this book are still very much relevant.

I'm really excited to learn that Think Python has become more modern and interactive with this update!

rami3l commented on Fourteen Years of Go   go.dev/blog/14years... · Posted by u/keyle
kunley · 2 years ago
Naah, in my observation it is kind of bashing which is almost always around the fact that Go is not Rust, which amazes me each time why certain individuals do that instead of simply coding in Rust or writing more about Rust.

(Funny that it applies almost exclusively to Rust folks; I never saw any negativity towards Go from Zig folks, for example).

These individuals will of course downvote this comment as well as my previous comment, because they are so deeply emotionally tied to their choice of language that they hate even mentioning the mechanism; but I don't care about my points here, instead I care much more about the truth and honesty

rami3l · 2 years ago
Rust dev here.

I really love the fact that most of the time people from the Golang community would like to say "look what I've made with Golang!" That's the sign of success: the users (here I mean general devs) should not care too much about the language per se, they still have applications to ship!

Rustaceans tend to talk more about cool new language features. They are critical to what Rust does, but maybe they have also got too much attention.

rami3l commented on Advanced Python Mastery   github.com/dabeaz-course/... · Posted by u/a_bonobo
kingkongjaffa · 2 years ago
Something I hate in my own code is this pattern of instantiating an empty list and then iterating on it when reading files. Is there a better way than starting lst= [] and then later doing lst.append()

This is an example from the linked course https://github.com/dabeaz-course/python-mastery/blob/main/Ex...:

``` # readport.py

import csv

# A function that reads a file into a list of dicts

def read_portfolio(filename):

    portfolio = []

    with open(filename) as f:

        rows = csv.reader(f)

        headers = next(rows)

        for row in rows:

            record = {

                'name' : row[0],

                'shares' : int(row[1]),

                'price' : float(row[2])

            }

            portfolio.append(record)

    return portfolio
```

rami3l · 2 years ago
I have also encountered this quite often. I'll say the ideal solution would be "postfix streaming methods" like `.filter` and `.map`. Unfortunately, Python doesn't have those (prefix `filter`s and `map`s are not even close), and you have comprehension expressions at best. To make things worse, complex comprehensions can also create confusion, so for your particular example I'll probably say it's acceptable. It could be better if you use unpacking instead of indexing though, as others have pointed out.
rami3l commented on Why F# evangelism isn't working (2015)   ericsink.com/entries/fsha... · Posted by u/luu
xupybd · 2 years ago
> not rich in community libraries, like a desert & abandonware

You have access to the entire .net ecosystem?

rami3l · 2 years ago
The last time I gave F# a shot, I tried to write a simple Telegram bot in it.

Just to test how much I would actually benefit from the .NET ecosystem, I chose to use a C# wrapper for the Telegram API. Suddenly I had to handle null references and exceptions everywhere (it's in this regard even worse than Rust, where I'm guaranteed to get Options and Results).

I know proper support for C# T? type interop is in the works (https://github.com/dotnet/fsharp/pull/15181), but really it seemed to me that too few cared about F# to get it landed in a reasonable timeframe.

I'd really love to see a pragmatic FP language with a reasonable amount of libs to choose from (both natively and via interop without much effort), but F# was a bit far from that description IMO.

rami3l commented on Writing Python like it's Rust   kobzol.github.io/rust/pyt... · Posted by u/thunderbong
drekipus · 2 years ago
I love python, and I understand the importance of typing, but is there a way to have less physical keyboard typing?

Consider the two examples:

`private Dictionary<RoadPlate, List<RoadPlate>> road = new Dictionary<RoadPlate, List<RoadPlate>>();`

`road : dict[RoadPlate, List[RoadPlate] = {}`

Or even just `road = {}`

I prefer python simply due to needing less writing and less reading. I can think more about the program when there's less stuff to read

rami3l · 2 years ago
Indeed, that has been a real problem, so now you can probably write `private Dictionary<RoadPlate, List<RoadPlate>> road = new();`.

u/rami3l

KarmaCake day23January 20, 2022View Original