HNHacker News
TopNewBestAskShowJobs

fredmorcos

56 karma · joined March 20, 2012

submissionscomments
fredmorcos··on My Mechanical Keyboard
The sound dampening pad does not dampen switch and keycap noise.
fredmorcos··on C Is Not Reasonable
Has nothing to do with syntax.
fredmorcos··on C Is Not Reasonable
> whilst "int.add" and "float.add" are alternative implementations of the same signature.

Maybe in a functional programming language like Haskell. But not in C++.

fredmorcos··on C Is Not Reasonable
C portability is not portability in the Java or Python sense. It's portability across architectures, and undefined (and implementation-defined) behavior is a powerful tool for that.
fredmorcos··on C Is Not Reasonable
> or allow the programmer to specify which one should be used with an annotation.

That's exactly:

> give all of those functions different names.

fredmorcos··on C Is Not Reasonable
I really couldn't organize my thoughts from the sheer amount of criticism I have of this blog post. So instead, I'll kindly ask anyone to give this person a "do what I mean, and not what I say" programming language.

And they will realize that even that has quirks.

fredmorcos··on LXQt 0.11 Released
Absolutely, but you'd be a nice guy if you factor out the essential and common parts into C libraries, so that others can make use of it as well (from any language and framework) which increases collaboration and decreases fragmentation.

Some might see the need for C libraries as evil and unnecessary (I personally don't), but it's the situation we're in.

fredmorcos··on LXQt 0.11 Released
> Almost nobody actually collaborates on anything. Everybody wants to do their own thing and it leads to developer fragmentation. Every project is undermanned. LXQt is especially undermanned right now. The Cinnamon guys, last I heard, want to switch to Qt but don't have the developers to do it and would end up being a LXQt clone.

As an example, instead of starting another desktop project (lxde, razor-qt, lxqt), some could have contributed to or collaborated with xfce.

> Nobody needs that many desktops, especially when nearly all of them are clones of each other in either GTK or Qt and 95% of the apps duplicate each others' functionality.

In a way like lxde, razor-qt, lxqt in relation to xfce.

Seems like you've contributed quite a bit to the fragmentation, coming back and preaching collaboration will at best only fix part of the problem.

fredmorcos··on OpenSSL Security Advisory
(Just my opinion)

I completely agree with everything you point out. The argument I am bringing up is not about implementation, it's about "if they didn't use C, they would have less (security) problems": No.

C is the way it is towards secure coding because there are compromises to satisfy other dimensions. <Fancy new language that promises to solve all of C's problems> is either making huge sacrifices in these other dimensions or is at best an experiment.

We understand C's weak points so well (due to being widespread, battle tested, really simple, or what have you), that most of the time it's safer (read: more secure) to tread dangerous well-understood territories carefully than uncharted ones only promising to be safe.

fredmorcos··on OpenSSL Security Advisory
I hope I don't come across too harsh.

Is HN still really up for that argument? Yes, we know the downsides of C. But the upside is that _we know the downsides of C_.

Constantly complaining about C isn't going to get anyone anywhere. It's been shown over and over again that secure C coding is possible and doable and feasible and exists in the real world. Some of the most secure software is written in C, and that's not attributed to enough fingers banging at a keyboard over a C program, but because C forces the programmer that _wants_ to write a secure program think about all the issues, the universe and everything.

So please, pave the road and show us the safer OpenSSL-rust you have. Until then good luck and thank you for your feedback.

fredmorcos··on OpenBSD 6.0 released
Have you tried ftp2? I had problems today with one of them (can't remember which worked and which didn't).

EDIT: http://ftp2.eu.openbsd.org/pub/OpenBSD/

fredmorcos··on Picolisp
I think they were referring to the fact that 'de' isn't much of a shorthand for 'def' and that 'prin' isn't much of a shorthand for 'print'.
fredmorcos··on Checked C
So they couldn't be bothered to contribute that directly back to LLVM/Clang or am I missing something?
fredmorcos··on Intel acquires Itseez, leading developer of OpenCV
> transform themselves from a company that does cutting-edge research and makes universally useful products into a corporate blob with no specific purpose and niche products of dubious quality.

This is very true and funny only when read as a sarcastic comment.

fredmorcos··on Chez Scheme is now free
> Just like C had to add things like arrays to the Turing machine?

Care to elaborate on that?

fredmorcos··on OpenBSD 5.9 released early
Yes! That definitely reinforces my understanding. So Rust is more like C and less like C++ in that it is pass-by-value everywhere, with the exception that references are not pointers but _real_ references.

Does this make things like "const int * const x" (in C syntax) pointless in Rust?

Does that mean that in Rust I can only pass to a function an immutable reference to a mutable object, but not a mutable reference to an immutable object?

Also, out of curiosity, how would something like a recv() call into the middle of an array (buffer) look like in rust? Something like "recv(sock_fd, buf + 5 * sizeof(char), buf_len - 5 * sizeof(char), 0)"?

fredmorcos··on OpenBSD 5.9 released early
Thanks :) You've given me a lot to go through over the weekend.

Regarding Haskell, I used LYAH and the standard library documentation.

I agree that Haskell is not easy to learn and that the libraries require a lot of foundation before becoming understandable and/or usable (eg, Monoids -> Applicatives/Monads vs. "I just want to read the contents of this file into a string"). The language "proper" is built on extremely simple and straightforward concepts.

fredmorcos··on OpenBSD 5.9 released early
Sorry for not being clear on this. I was not talking about Julia code crashing. What I meant was when playing around with it, the julia binary would segfault here and there.

echo "print(3)" > boot.jl

julia --compile=all -O --inline=yes --check-bounds=no --output-o foo.o

fredmorcos··on OpenBSD 5.9 released early
Wow, thank you for that reply!

I don't think that C stays alive because people just automatically rejected anything else. There is something to C that I appreciate extremely, and that is the clarity and simple semantics: there is not much hiding and unintentional obfuscation that one can cause when writing C code.

Maybe safety and simplicity are mutually exclusive if speed and fine-grained control over memory are the main goals.

For Modula, the tools and documentation are not being updated anymore, I could not find a programming environment for eg., emacs and on armv6.

Free Pascal and Lazarus are great, until I realized there were no resources to learn modern pascal from. The emacs mode is too basic and doesn't take any advantage of things offered by fpc. But I have to admit, I've never seen anything as good as Lazarus before.

D is more like a C++ successor that's aiming at Java than a successor to C. It is complex and does not seem to be making any effort in unifying its concepts: in the same spirit of C++.

Cyclone is definitely interesting, but unmaintained and not exactly simple, similarly to Rust but with a C-like syntax.

Julia crashes all the time with segmentation faults, sorry, the quality of Julia is super low. I would not use it for anything serious. It has great ideas though.

OCaml is super complex with its syntax and semantics.

I love Haskell, which makes great efforts to unify its concepts: the language is super simple (its implementation can be arbitrarily complicated). Haskell is where I go to write beautiful things. Fast (like, systems programming fast) Haskell code is ugly and unmaintainable and defeats the purpose of choosing Haskell in the first place.

I'll be taking a look at the rest! Thanks!

fredmorcos··on OpenBSD 5.9 released early
In this video[0] on Rust, in this example I was unable to directly tell whether the Vec structure is being copied to the take() function. If ownership is being handed over, why is a copy being made? And if a copy really isn't being made, then why aren't the function signature and the calling site reflecting that?

I hope I am making any sense... Please tell me if I should try to rephrase, or if I am in need of clarification on the subject.

(BTW, this is also something I really dislike about C++, two function calls that look exactly the same, foo(x) and bar(x), could either be pass by value or pass by reference: you have to go dig up the function signatures to figure that out).

[0] https://youtu.be/O5vzLKg7y-k?t=1110

fredmorcos··on OpenBSD 5.9 released early
I am genuinely wondering, what is (or could you point me to) the alternative with the following properties:

- Compiled, type-safe and available for armv6.

- Simple semantics: Rust and Ada are complex (C++-ish) and it gets hard to limit the number of memory allocations/accesses as well as data copies going on.

- Tooling and discoverability: Man pages and Emacs with a few modes that are easy to setup beats anything I've tried so far.

I understand that C has shortcomings when it comes to safety/security and even lacks features that would make programming certain things easier, but what do you suggest I use when I want to write a UNIX daemon that needs to transfer a boatload of data from disk over the network and vice-versa?

I personally like it, I find it to be clear and concise, a little tedious but at the price of giving me fine grained control over the data in memory: I just have to be careful with that.

fredmorcos··on Lazarus Version 1.6
Could you refer me to good modern resources? I am fluent in C programming and would really like to get started with Pascal and Object Pascal using FPC and Lazarus. I really think the language adds a lot of nice things compared to C without sacrificing C's advantages and without becoming C++. The only problem I'm currently facing is finding resources to learn.
fredmorcos··on Diff So Fancy: make Git diffs look good
And? What do I need to do to get that? :)
fredmorcos··on Ask HN: Do you use an old or 'unfashionable' programming language?
Could you refer me to a good introduction-intermediate level resource to learn modern Pascal? I currently work on my projects in C (quite fluent) and am constantly looking for a language that offers proper type safety, generics and a good module system without being overly complex (eg, C++). Pascal and Object Pascal seem like a really good fit but I can't get my hands on a high quality walk-through of the language implemented by FreePascal and its standard library.
fredmorcos··on The Landscape of Parallelism in C++ [video]
<rant>

This talk was amazing, I was overwhelmed by the amount of work going into C++. The problem is that it is already an abysmally complex language (to me) and it doesn't look like anything is getting simpler. It's as if you had to be there from the start to have a full image of how the language grew and truly understand the interplay between all the "features", otherwise it's too late to become an expert, and in some cases even too late to become comfortable writing good maintainable code in C++.

Unfortunately nothing comes close to its level of "practical usefulness" in all dimensions (expressiveness, reasonable speed, ecosystem, etc...). I personally just stick to C because things are simple to understand and I just live with its shortcomings.

fredmorcos··on Free Pascal Compiler Version 3.0.0
I am currently working on a project that I will be using at home between my laptop and (not so powerful) Raspberry PI. I am well versed in C and this project is written in it, with very minimal dependencies (currently talloc, libbsd and makeheaders). I am trying to keep resource usage at a bare minimum on the server side (Raspberry PI) for obvious reasons.

I've never worked with Pascal, and I've been looking for an alternative to C that solves some of the issues I'm having without sacrificing too many of its advantages. Since fpc is available for armv6, I am wondering if someone could give me advice on whether moving this project to Pascal would be beneficial, especially compared to the following points:

- A proper module system, without having to keep .h and .c files in sync when the interfaces aren't stable yet. I am currently using makeheaders to make things less annoying for me.

- Compiler warnings, cppcheck and scan-build offer me great feedback. Emacs integration of these tools is priceless.

- The ability to do things like recv() into the middle of a buffer. That is just too efficient to let go of. I think this is something many people overlook when comparing C to other programming languages, many times you can turn O(2n) into O(n) by taking advantage of this. Not theoretically different, but in practice it can pay off.

- Emacs integration and support. Nice to have would be support for auto-completion, static analysis, etc...

- Documentation. Man 2, 3 and 3p are priceless. Emacs man integration is great.

- Number types that are exactly the same across architectures. eg, I've had issues because off_t was ulong on one machine and ulonglong on the other.

- Memory management, error handling and everything you need to do that has nothing to do with the task at hand. It gets old quickly.

- Optionally high-level, I am comfortable working with pointers and addressing memory directly, but sometimes I look for elegance where I know performance is not going to be affected too much (ie, the trade-off is acceptable). This also means that when I'm working with higher-level constructs, I'd like to have easy access to the inner workings so that I can make such a judgement myself (either through documentation or other means).

- I don't care too much about compilation speed.

- Easy semantics and simplicity of things. I really don't think I can put that into words, it's better understood through experience. But this is one of the biggest reasons I stick with C rather than C++ or Rust.

- The availability of a widely approved guide that doesn't go into the very basics of programming to explain the language (maybe some sort of Pascal for C people kind of thing).

- There are probably a few more points I could talk about but can't think of right now. I could write them down some time later if anyone is interested.

Thank you in advance, I would really appreciate if anybody can help me with these points, I'm looking for new adventures :)

fredmorcos··on UBlock Origin
Addons.Mozilla.Org
fredmorcos··on How Is Critical Life or Death Software Tested?
> Reliability was favored over other things (for example recursion was discouraged).

This sounds really strange to me. So may I ask why? I find that recursion - most of the time - helps shorten and clarify the code. Also, doesn't recursion make induction proofs trivial?

fredmorcos··on The death of optimizing compilers [pdf]
Anything you can point me to?
fredmorcos··on OpenBSD kernel source file style guide
Here's a question, since the man page mentions splint. Has anyone here ever managed to reach a splint warning-free project?
← PreviousPage 3 of 4Next →