HNHacker News
TopNewBestAskShowJobs

Anilm3

418 karma · joined September 8, 2010

submissionscomments
Anilm3··on Show HN: Alacritty, a GPU-accelerated terminal emulator written in Rust
This is a very interesting concept and another example of what can be done with Rust. However and without the intention of discouraging the author, I did not find any performance improvement from Alacritty using Ubuntu 16.04 on an i7-4500U (using integrated graphics HD 4400). Here are some numbers, simply printing the contents of 446 files:

At 80x24:

gnome-terminal:

  real	0m0.848s
  user	0m0.032s
  sys	0m0.072s
Alacritty:

  real	0m6.832s
  user	0m0.032s
  sys	0m0.164s
At fullscreen:

gnome-terminal:

  real	0m0.819s
  user	0m0.020s
  sys	0m0.088s
Alacritty:

  real	0m8.972s
  user	0m0.064s
  sys	0m0.164s
The font was a tad smaller by default on Alacritty, changing it made no significant difference in the numbers. Since the difference in performance was quite noticeable I decided not to test other possible configurations, but I could do so if it might help.

My graphics card has a pretty poor performance in general so that might be an indication that, since the performance of Alacritty is directly impacted by the graphics card, it might be useful for the author to determine the "minimum requirements" for Alacritty to outperform the competition.

In any case, it might not be a fair comparison as the author has stated that this is a pre-alpha release, but maybe he can find it helpful in some way, as he suggests he hasn't been able to find a test in which Alacritty didn't perform as well as another terminal.

Anilm3··on Using Simulated Annealing to Solve Logic Puzzles
Really interesting, I wrote a logic puzzle solver in Prolog a long time ago while I was in uni, I just created a repo for anyone who wants to check it out. Unfortunately the documentation and comments are all in Spanish...

https://github.com/Anilm3/Logic-Puzzle-Solver

Anilm3··on A critique of "How to C in 2016"
I don't see the point of the discussion, that piece of code (or relatively equivalent), is already being performed by a libC function (calloc, in this case), how is that less convenient than you writing it yourself?

It has nothing to do with how smart you are or how low level C is, you are effectively reinventing that part of calloc by wrapping malloc.

Anilm3··on A critique of "How to C in 2016"
Agreed, but there's little point in reinventing the wheel in this particular case.
Anilm3··on A critique of "How to C in 2016"
One of the most important reasons to use calloc, other than the zeroing of the allocated memory, is the fact that it checks for integer overflows (at least on most implementations).

For example, when allocating an array of n elements, in malloc you would do something like the following:

ptr = malloc(sizeof(int) * n);

Which could potentially lead to an overflow of the size passed to malloc, hence allocating a significantly smaller buffer and end up accessing adjacent memory which hasn't been allocated to the buffer (buffer overflow)

Calloc requires two arguments, one for size and one for number of elements, which allows it to check for an overflow before performing an allocation (e.g. by using SIZE_MAX):

ptr = calloc(n, sizeof(int));

This is not to say that zeroing memory is not useful. There are many situations in which a zero in a memory block represents the end of the usable data, as for example in a string, so zeroing memory in those situations is definitely recommended.

Anilm3··on Resolutions for programmers (2012)
Very interesting article! I like the fact that you mentioned Prolog as one of the less mainstream languages to learn. During my time at uni I found that both Haskell and Prolog really changed the way I approached different problems and gave me a high level perspective to problem solving. Some interesting resources to learn Prolog:

# http://www.swi-prolog.org/

# http://people.cs.kuleuven.be/~bart.demoen/PrologProgrammingC...

# http://www.cs.bham.ac.uk/~pjh/prolog_module/sem242.html

# http://www.learnprolognow.org/

I'm getting an itch now, I think I'll give Prolog a second go this new year.

Anilm3··on Ask HN: Are you programming on your holidays?
I agree that it's important to unplug every once in a while, but for some, programming is like reading. As an analogy consider a lawyer reading legal documents all day at work and going back home and reading a novel, it's exactly the same for me, working on my own projects is exciting and enjoyable.
Anilm3··on Receiving NOAA Weather Satellite Images
Some other interesting links:

http://markroland.com/portfolio/weather-satellite-imaging

http://www.wxtoimg.com/

Anilm3··on Ask HN: What projects are you working on?
I'm working on a library to provide the same capabilities of the STL but in C:

https://github.com/Anilm3/ARC-Library

I don't have much time due to my job, but it's quite a lot of fun to work on it.

Anilm3··on Shippo: The brain-controlled tail that wags with your mood
Absolutely ridiculous....
Anilm3··on RIAA Insists That, Really, The Music Industry Is Collapsing
"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably."

Music industry should die for what it's trying to do with our liberties.

Anilm3··on Why I am coder and so should you
I agree he was pretty harsh, just keep trying if that's what you really want, someday you'll get it right.

But please, there are numerous adjectives that can be used to describe coding and sexy just isn't one of them.

Anilm3··on Why I am coder and so should you
I stopped reading here:

Coding is limitless, awesome, and sexy.

Anilm3··on John McCarthy Has Died
I am without words, rest in peace.
Anilm3··on What's your C migration plan?
Interesting, do you have an example?
Anilm3··on The Real Reason We'll Miss Steve Jobs
We're not going to miss him if you guys don't stop posting stuff about him. In fact, personally, I'm getting tired of the man.
Anilm3··on Live Like Steve
Leave the guy rest in peace for a while.
Anilm3··on Android Tricorder Killed By CBS
Mr. Roddenberry must be turning in his grave...
Anilm3··on Google Chrome saved me $4,500
Buying new hardware is never a solution for a bad user experience, at least not with the laptop you own.
Anilm3··on Ask HN: Favorite pointer tricks in C?
thx!
Anilm3··on Ask HN: Favorite pointer tricks in C?
Could you put an example?
Anilm3··on Painless Command Line Argument Parsing in C
Software reuse is a great thing, but not to the point of criminalizing learning.