[-] RangerHere@programming.dev 2 points 1 month ago

This was a good read. Thanks for posting.

[-] RangerHere@programming.dev 11 points 1 year ago* (last edited 1 year ago)

I love Rust. Although I agree with everything else, I would definitely not say "same amount of effort".

[-] RangerHere@programming.dev 4 points 1 year ago

Transistor is one of my top games. I think you would like it.

[-] RangerHere@programming.dev 7 points 1 year ago

I am just adding my humble opinion but Pyre is the only SuperGiant game that I don't like.

[-] RangerHere@programming.dev 2 points 1 year ago* (last edited 1 year ago)

Here are couple suggestions about how to improve your algorithm:

First of all, you should reduce the number of calls to realloc function. This is because, this function will often need to switch to the kernel space to be able to do the reallocation. I think it is nice to allocate the same size as a single page or multiples of page size from the virtual memory. I think you should allocate 4KB or 2MB of memory at the beginning of the function. Then reallocate multiples of the page size when you need to reallocate memory.

Second of all, reading the input one character at a time is also time-consuming. Repeatedly calling this function means you will end up going to the kernel space, grabbing a single character from there, then coming back to the user space (I used this as an example, there are many buffers between your application and kernel space). Instead I would suggest you to read 4 kB at the time using read or fread functions.

If you do not know about files, caching, virtual memory, page sizes, kernel space, user space, and optimization then please disregard everything I said. This will only confuse you now. I know it is a lot of fun to start thinking about optimization when you are learning a new programming language, on the other hand as mathematician and computer scientist Donald Knuth said, premature optimization is the root of all evil.

I hope this answer helps you.

[-] RangerHere@programming.dev 2 points 1 year ago

This guy is right. I saw OP's post but I did not have enough time to reply at the time. I came back to reply to OP's post, but you are already right.

[-] RangerHere@programming.dev 16 points 1 year ago* (last edited 1 year ago)

I used to be Slackware user. Then I sold my soul to RedHat, then to Debian...

I just installed Slackware after reading your message to see what is new, here are my findings:

  • There is still no auto install. I had to manually configure a lot of things using a terminal based fdisk and setup.

  • The default package manager, pkgtool, does not have a default way to auto install packages from web (something like yum, apt, up2date). It only installs from your own HDD.

  • The other tool for managing packages, slackpkg, was not installed on my system by default.

  • The default configuration for X and KDE has problems on my system. I can see the mouse move then nothing.

I can understand why somebody would like to play around with this kind of system as a fun/entertainment/puzzle solving in their free time. On the other hand, if you plan to run some kind of microservices architecture on this, then I wish you best of luck finding a new job once you are fired.

[-] RangerHere@programming.dev 13 points 1 year ago* (last edited 1 year ago)

Come to the Debian side, it's all unicorns and rainbows here 🥳🦄

[-] RangerHere@programming.dev 1 points 1 year ago

Peter Norvig and LISP.

Then I learned Haskell on my own.

[-] RangerHere@programming.dev 9 points 1 year ago

Same here... I like it a lot.

[-] RangerHere@programming.dev 6 points 1 year ago* (last edited 1 year ago)

The worst case of this I heard was a crypto developer that lost 300k$ of clients money when he accidentally pushed some crypto keys to GitHub public repository. Last I heard he was getting sued.

[-] RangerHere@programming.dev 9 points 1 year ago

If you don't mind me asking, why do you not like systemd? I like it a lot and in my humble opinion it makes life really easy.

view more: next ›

RangerHere

joined 1 year ago