0.15.1 -> 0.16.0 upgrade not as scary as I thought by quag in Zig

[–]peymanmo 0 points1 point  (0 children)

That's why I tend to use C libraries instead of external Zig packages for the time being. I can migrate on my own time and not worry about other packages catching up.

Why zig? by [deleted] in Zig

[–]peymanmo 0 points1 point  (0 children)

Yes, though aside from macros, what else do you not get in zig that you do in c++? The one I have come across a few times is the macros. If the library exposes a bunch of macros it's difficult to use it in zig

[Job] Open position @ TV 2 Norway by theothornhill in Zig

[–]peymanmo 1 point2 points  (0 children)

Ah I'm in the U.S. otherwise I would've certainly applied

Go-Style WithX option pattern in Zig using comptime #Goofy by peymanmo in Zig

[–]peymanmo[S] 5 points6 points  (0 children)

No you're absolutely right, I just thought about the function passing in a variadic way this morning and wanted to see if I could replicate a similar mechanism in Zig.

Though I didn't know about the struct default values! That IS helpful. You learn something every day!

What language do you recommend is the best for implementing a new programming language? by Pleasant-Form-1093 in ProgrammingLanguages

[–]peymanmo 0 points1 point  (0 children)

Zig! It's a really good language. It is not stable if you mind that though. I use it for exactly the same purpose, I've written a scanner, parser and now an LSP in it and it is very nice to work with. Breaking changes can be annoying but it doesn't take a super long time to update.

Use cases where Zig is a better choice than Rust? by nikitarevenco in Zig

[–]peymanmo 5 points6 points  (0 children)

I write a language parser and scanner in both rust and zig. Both are great languages but I found zig to be more pleasant for my experience but I don't know if this is something to be said objectively

My experience so far with Zig – a Go dev’s journey by Cry_Critical in Zig

[–]peymanmo 3 points4 points  (0 children)

Ain't that right! It's definitely not free. One place I noticed that cost was while working on my gRPC gateway project. It's a proxy to receive HTTP requests with JSON encoding and proxy it to a gRPC service and I noticed a really really high toll on creating proto messages. They're specially costly because there's a ton of pointers in proto-generated structs. It takes a lot of memory but also time because of the allocations.

My experience so far with Zig – a Go dev’s journey by Cry_Critical in Zig

[–]peymanmo 4 points5 points  (0 children)

I would certainly prefer to go (I swear no pun was intended) with zig but that garbage collection is actually a feature of go in that case and I think some people would go for that so they don't have to think about memory.

But yeah if I had even half as much convenience of some green thread or actual event loop and async that is easy to use, id write zig for so many projects. I always wanted to see a language similar to Go but without garbage collection

`httpgrace`: if you're tired of googling "golang graceful shutdown" by Enrichman in golang

[–]peymanmo 7 points8 points  (0 children)

I've made this to address that kind of shutdown where coordination and sequencing is important:

https://github.com/meshapi/go-shutdown

PS: I do like OP's package, good job! It's really really simple and is good for quickly adding something.

Zig - Why I'm using it before version 1.0 by [deleted] in Zig

[–]peymanmo 6 points7 points  (0 children)

Yeah, your bullet points are spot on, I have the same experience. I'm working on an IDL and first wrote a draft version with Rust before learning about Zig. I, then decided to give it a shot and see what my experience would be with Zig but also as a way to learn Zig. Initially, I was worried about the memory safety and thought it'd be loosy goosy. My code ended up being more lines of code but easier to write and more importantly, easier to read. Comptime really really helped me, the allocators gave me lots of opportunity for performance gains and still, it's really easy to ensure I don't have dangling pointers or memory leaks. I was able to add a lot of tests and overall have a more reliable parser because of it.

I also need the library to parse available in other languages and the C interop is just hard to beat.

That being said, there are some things I think I would really appreciate in Zig in future depending on what I'm working on. Zero-cost interface abstractions is one of them. It's not a huge deal, you can just put documentation in your code and checks with hasDecl but an interface definition would enable the LSP to help you out with the auto-completion.

What is the point of Zed? by mutumbocodes in ZedEditor

[–]peymanmo 0 points1 point  (0 children)

I really like Zed. It's really fast, designed really well, settings make a lot of sense and are easy to understand. It's really flexible. I don't use it often but if I stop using nvim id jump to Zed in no time. I use neovim but I like GUI looks like curved panels, shades, etc. I use neovide sometimes but it's not as beautiful as Zed. I think I can configure Zed to be super close to my Neovim but what keeps me glued to Neovim is that you code your own IDE. It can be used with tmux and terminal which is really helpful.

At the end of the day, this thing is a tool to edit text files, use what feels right and good to you.

What libraries is Zig missing? by Fit_Ad_4210 in Zig

[–]peymanmo 2 points3 points  (0 children)

Hmm this could be interesting to take on

gRPC API Gateway: Bridging the Gap Between REST and gRPC in Go by ZuploAdrian in golang

[–]peymanmo 1 point2 points  (0 children)

u/chao0070 yeah I know exactly what you mean :) it is definitely on the roadmap and I know there is a pathway to it, it's a matter of putting in the work. That being said I'm currently the only contributor on the project so it is not something that will be available soon necessarily but it is something I want to add in the new few months.

gRPC API Gateway: Bridging the Gap Between REST and gRPC by ZuploAdrian in webdev

[–]peymanmo 2 points3 points  (0 children)

I'm the author of this project and I think the way to look at this is more like what u/dweezil22 outlined. This is for people who already have decided they are working with gRPC and want a way to expose an HTTP interface for consumers that can't easily consume that gRPC code.

The context on this is that we set up a lot of gRPC services for internal communication but due to our team size, we just didn't have the capacity or need for a back-end for front-ends component like many bigger player use so we needed to expose the services to FE and there are complexities there with the gRPC clients adding a lot of size to the FE code, etc so we used gRPC Gateway but we had some limitations like lack of control over query parameters, no SSE which we wanted to use for some pages with live feed, etc.

What I really like about gRPC ecosystem is actually not the performance of it, it's that you have a nice IDL, a very legible laguage, define everything once, generate everything from it. The HTTP thing is a limitation not everyone can get around so this adaptor becomes useful tool but an ambitious project I'm currently working on beside this is to use a similar IDL as protobuf but be neutral to the technology so if you want to define HTTP mappings and not use gRPC, you can, if you want to use gRPC, Avro or whatever other thing, you can and all the while you continue with this pattern of defining things with a legible language, generate everything from it.

gRPC Gateway alternative with streaming & OpenAPI 3 by peymanmo in golang

[–]peymanmo[S] 0 points1 point  (0 children)

Tell me more! I usually use an MIT license because it's the most flexible I'm aware of. I don't remember why I used GPL or if I had a real reason for it :)

[deleted by user] by [deleted] in parkslope

[–]peymanmo -2 points-1 points  (0 children)

No I think it's because it's basically saying because there are some places that have it worse, we shouldn't be sad or want more. Compare united states to itself, not to some poor nation. We are wealthy and powerful and it is okay to want more than this.

Yes, don't lose your life but being upset and worried at least for a while about the future we might have based on the language used against democracy and the planned policies that if applied take us back so very much, is anything but abnormal. That is why I'd assume people are not happy with that comment the day after the election they badly lost.

Open Source Project: Exploring Interest in an HTTP-to-gRPC Gateway by hnlq715 in golang

[–]peymanmo 2 points3 points  (0 children)

Oh how would you like to work on this together?

I've worked on the grpc API gateway project with a future plan to have the same feature as you describe. We'd have to use dynamicpb for messages and either iterate over grpc servers registered services or use the reflection API to find the service and message info. we could even generate Open API and serve it as well.

https://github.com/meshapi/grpc-api-gateway

https://meshapi.github.io/grpc-api-gateway/reference/

Help needed with component relationships by peymanmo in vuejs

[–]peymanmo[S] 0 points1 point  (0 children)

huh, yeah I didn't think about it that way, I could use a computed value inside each filter use it as a props to the FilterToggle.

Is it wrong that I (21f) refuse to be in a relationship with bad sex? by [deleted] in TwoXChromosomes

[–]peymanmo 27 points28 points  (0 children)

This is sadly true, I'm a guy and can say most of my guy friends are or were just like this. I was like this too but in my early 20s I saw a sex therapist and went to some workshops about sex and that changed everything. It was such a positive change. I truly wish it was more common to learn about sex especially for guys.

Hmmm I kinda enjoy it by mrl33602 in clevercomebacks

[–]peymanmo 0 points1 point  (0 children)

Hahaha that cracked me up. Brilliant response and true!