HNHacker News
TopNewBestAskShowJobs

linkdd

2,632 karma · joined June 19, 2019

email: david.jose.delassus@gmail.com

  - https://link-society.com
  - https://krouter.cloud
  - https://flowg.cloud
  - https://linkdd.github.io
  - https://david-delassus.medium.com
submissionscomments
linkdd··on Chess is booming and our servers are struggling
Lichess has less chess variants, less learning content (made by IMs and GMs), and has some gameplay differences:

  - on chess.com you can premove multiple times, each premove consume 0.1s on the clock
  - on lichess, you can premove only one time, but it does not consume time on the clock
Also the player pool being different, the rankings are not equivalent, and chess.com's player pool is bigger.

Also, from personal experience (so this is only anecdotal), the most toxic players (insulting in the chat, or ragequitting, ...) I met were on lichess.

Comments of the form "X is better than Y" are subjective and do not add any value/information to the discussion.

linkdd··on OOP in C
Ah thank you, it predates Github's renaming of Github Pages from .com to .io --> https://linkdd.github.io/ooduck/
linkdd··on OOP in C
You mean "C with classes" ?
linkdd··on OOP in C
Years ago, I started an implementation of that book: https://github.com/linkdd/ooduck

Never truly finished it, but it works well :)

linkdd··on PHP: Prolog Home Page
Well, a CGI script isn't really a web server.
linkdd··on CLib: Header-only C library that implements the most important classes from GLib
imgui distribute .c/.h files, not .h files with .c embedded in them.

What I'm criticizing is the extra step of me having to write the .c files anyway to avoid bloating the obj files, which should have been done by the library in the first place.

linkdd··on CLib: Header-only C library that implements the most important classes from GLib
There are billions of flies who eat shit. Therefore, shit should be edible?

The "numbers argument" is a fallacious one.

No, "how you are supposed to distribute a C library" is not my opinion, but the experience/observations of the last 50 years of engineering. Why would we even have a .so/.a/.lib/.dll format for libraries?

As I said in a sibling comment, those are not header-only libraries. It's poorly packaged .c/.h in a single file that we happened to name with the .h extension.

It's not a header, it's a header+implementation. And it's bad practice, and any decent C developer will tell you so.

linkdd··on CLib: Header-only C library that implements the most important classes from GLib
By not making a choice, the library is actually making the worst possible decision.

It is bloating my ABI if I'm not careful, and it makes distributing more cumbersome when it could/should be straightforward.

That's just not how you are supposed to distribute a C library, this is a poor design that clearly states "I don't know or don't care how to package my code".

linkdd··on CLib: Header-only C library that implements the most important classes from GLib
You missed the "with extra steps".

  #define XXX_IMPL
  #include "xxx.h"
And

  #include "xxx.c"
Are exactly the same trash.
linkdd··on CLib: Header-only C library that implements the most important classes from GLib
Because:

  - I like my object files (.o) to only contain what they are supposed to contain and nothing else
  - I don't want to have to keep track of where did I put the `XXX_IMPL`
No I'm not missing the point of how it is meant to be used, I'm criticizing that use case as a very poor one, I'd even say it's an anti-pattern IMHO.
linkdd··on CLib: Header-only C library that implements the most important classes from GLib
If the library was instead giving me a .c and a .h, I would simply need to make that CMakeLists.txt, or a Makefile, or whatever build system I use.

Now, the library gives me a .h and a `#define XXX_IMPL`. So to avoid making the mistake of defining XXX_IMPL more than once, I'll have to make a .c myself for each file of the library, and then I still need to write the CMakeLists.txt/Makefile/whatever.

This is just wasting my time for no good reasons.

I linked the imgui repository because that's what they do, they give you the .c/.h and you decide how to build it. You just have to copy/paste, no time wasted.

linkdd··on CLib: Header-only C library that implements the most important classes from GLib
https://github.com/ocornut/imgui

> Just copy paste the source code in your source tree

And/Or make a simple CMakeLists.txt like this:

  cmake_minimum_required(VERSION 3.22.0)
  project(mylib C)

  file(GLOB_RECURSE MYLIB_SOURCES
    ${PROJECT_SOURCE_DIR}/src/*.c
  )

  file(GLOB_RECURSE MYLIB_HEADERS
    ${PROJECT_SOURCE_DIR}/include/*.h
  )

  add_library(${PROJECT_NAME} STATIC ${MYLIB_HEADERS} ${MYLIB_SOURCES})

  target_include_directories(${PROJECT_NAME}
    PRIVATE "${PROJECT_SOURCE_DIR}/include"
  )
linkdd··on CLib: Header-only C library that implements the most important classes from GLib
C Header-only libraries do not exist. It's just `#include "foo.c"` with extra steps.
linkdd··on CLib: Header-only C library that implements the most important classes from GLib
Forcing me to define `XXX_IMPL` in a single compilation unit is not a header-only library.

It will simply force me to make a `.c` file for every `.h` and define it there.

Why not simply distribute the .c/.h like imgui does, or lua, or many many others? I'm already copy/pasting your .h files, I would not mind copy/pasting .c files and adding them to my build system, since that's what I'm gonna do anyway to make sure i do not define `XXX_IMPL` multiple times.

Header-only libraries truly only work in C++ when it's all templates anyway.

linkdd··on Show HN: I Built Sailboat UI – Modern UI Framework for Tailwind CSS
150+ components but the doc lists less than 30, so I guess it's still a WIP?

The ones present looks good, though I was looking for a responsive navbar one (since that's a component I reuse in 99% of my projects).

I suck at CSS (I know the language, but I'm not a designer). It's like painting, I know how to take a brush and put paint on a canvas, but whatever I do is just ugly. This is why for frontend stuff, I like to rely on frameworks like https://bulma.io

Tailwind is a nice framework, but it requires me to know how to make something beautiful, which I'm unable to. So frameworks like this one are more than welcome!

linkdd··on Ask HN: Is it still worth learning Kubernetes in 2023?
Yes
linkdd··on In what programming language would you write new OS?
And in both cases:

Rust is still backward compatible (old code will compiles on newer compiler versions) so you won't be rewriting what already works.

You won't use unsafe that much (especially once the hardware parts have been abstracted), see the link I gave you as proof.

The advantages of Rust are not pointless:

  - the type system
  - the ownership/borrowing/move semantics
  - the ecosystem
  - the build system
  - the way you can contain the memory-unsafe parts in a small/controlled API
Fuschia and RedoxOS are very much not "research projects" and they manage very well their code maintainability.
linkdd··on In what programming language would you write new OS?
Maybe not the kernel since JS needs a runtime at least, but there is https://node-os.com/ based on the linux kernel.
linkdd··on In what programming language would you write new OS?
I'd recommend reading https://os.phil-opp.com/ to drive away those wrong assumptions.
linkdd··on In what programming language would you write new OS?
I'd still use C.
linkdd··on C++23: std:out_ptr and std:inout_ptr
This seems reasonable for working with C APIs.
linkdd··on C++23: std:out_ptr and std:inout_ptr
Why would you have to call `new`? Why would `malloc()` not work here?
linkdd··on Mangle, a programming language for deductive database programming
Inventing a language seems to be a rite of passage for every engineer at google.

Go, Dart, Carbon, Mangle, am I missing some?

I'm not criticizing, I would not dare as I'm creating my own language as well :P

linkdd··on Python 3.11.0 final
Trio is truly great, and they implemented MultiErrors (ExceptionGroup) long before it was considered to be a PEP.

I managed to make a very very simple OTP-like framework with Trio: https://linkdd.github.io/triotp/

linkdd··on Python 3.11.0 final
> And now for something completely different

Is a Monty Python reference, what follows is actually, completely different. They did not lie :)

linkdd··on Tinyphysicsengine: Minimalist 3D C99 single-header physics engine
https://github.com/eliben/pycparser
linkdd··on Tinyphysicsengine: Minimalist 3D C99 single-header physics engine
I should have said: the lack of standardized build system. CMake is a pain, Bazel, vcpkg, autotools, plain old Makefiles, etc... All of them do not match the developer experience of npm, cargo, etc...

Yeah we managed, I never said the opposite. I only talked about why I liked header-only libs: because I just copy/paste the source in my source tree, regardless of the build system I use.

If I'm using CMake, and a library is using autotools, I'll have to rewrite the lib's build system, and maintain it. I'm too lazy for that.

linkdd··on Tinyphysicsengine: Minimalist 3D C99 single-header physics engine
The lack of C or C++ build system makes me prefer header-only libraries, like nlohmann/json, entt, etc...

I do also like easily embeddable tech like imgui, or lua, where you can simply copy the source code in your source tree.

linkdd··on Tinyphysicsengine: Minimalist 3D C99 single-header physics engine

  mv mylib.h mylib.c
  gcc -c mylib.c -o mylib.o
Then link it as a .so/.dll or in a .a library. Done you can use it like any other library.
linkdd··on Ask HN: Is Therapy Helpful?
Billionaire or not, what someone believes is entirely up to him.

After further research, there is no scientific proof nor studies that would demonstrate the effectiveness of this method.

I would not underestimate the placebo effect, but a method where the name is a trademark, and can only be taught by people part of the organization seems too fishy.

If it is so effective, why is it not part of psychology curriculums?

← PreviousPage 7 of 29Next →