home.social

Anand :terminal: :gnu: :linux:

  1. What private DNSCrypt or DNS-over-HTTPS services running some foss software do you use?
    Preferably owned and hosted in Europe.

  2. I needed to throw over the table to fix this little one-line , but at least now it works. And I had to do some of the mess anyway.

  3. I'm giving up.
    I have been defeated by the spaghetti.
    I will... add comments.
    How terrible.

  4. I'm still designing my language.

    Why not just introduce RegExps into pointers?

    int *a; /* nonnull pointer to single int */
    int *?a; /* can-be-null pointer to single int */
    int +a; /* nonnull pointer to array begining */
    int +?a;

    Isn't using the nonnull __attribute__ a bit long?

    Now yes, I don't see the point of + and +?, but there is the 'array of unspecified length' syntax:
    int *argv[];
    so why not?

  5. Something works because of a bug. It shouldn't. I haven't programmed it yet. Bug located. Time to erase it. Time to stop positive anomalies. And take the long path to restore the correct behaviour.

  6. Vim is so intuitive and convenient

    I just typed `:imap dirs $partial_content.directories` and it worked exactly as expected.
    And removing the mapping is just as easy: `:iunmap dirs`.

    I wonder if Vim isn't just the thing joining one letter short, fast to type variable names with meaningful variable names :)

  7. I'm back to coding my browser again. Making the padding colourful, not just the borders improved my tester's experience drastically. After a little other cleaning the code and output both look better :)

  8. I'm language-hopping again.
    Now I hopped from to , earlier I have visited .

    Perl isn't difficult, not with my XP.
    I do have syntax problems, but once I developed an intuition for what a sigil means using the language gets smoother.

    I do have the feeling I can concentrate on the task with less worrying about the types.

  9. Got it!
    /usr/share/X11/xkb/rules/base.lst:887: caps:swapescape Swap Esc and Caps Lock
    This needs to be added to Option "XkbOptions" in /etc/X11/xorg.conf.d

    I haven't tested it yet, it might require an X reboot and I'm looking at another way, that I already found, to swap the 2 keys.

    This will be fun.
    It might not end at escape and caps lock... :)
    That will be more fun.

    Btw I used ArchWiki :)

  10. I've just tracked down a really annoying Lua bug in my Minetest mod.
    In Lua, assigning a table to a variable is assigning the reference to the table, not a copy of the table, while in C++, to which I'm used to unless I explicitly want the variable to store a pointer or reference, stuff will be copied.
    Fixing the bug is easy: var = table.copy(mytable), but finding it wasn't.
    table.copy is a small convenience function added by Minetest

    [1/2]

  11. A few days ago I edited one of my Minetest mods over ssh... 😆
    I couldn't test it, but it didn't matter.
    Soon I could access the computer directly

  12. StackOverflow is a nice C problemset.

    Solving an unanswered question would be fun even if you didn't post your answer.

  13. I don't care about doing stuff the right way.
    I do it in an effective way that works.
    For example: I have a function that recursively copies a small tree, built on the stack with pointers to rodata, each node has a name assigned to it.
    How do I make the nodes from one tree have different names to those of the nodes from the other tree?
    Simple.

  14. I'm starting to insert comments into my redo to remember the meanings of variables.

    I know the variable names should speak for themselves, but they don't... as usual :blobcatnotlikethis: :blobcatshrug:

  15. I won't use any big blob of software like Chromium-based WebContent, because I want my browser to be secure, that is security must be kept in mind through the whole process of programming, not be left for extensions to manage.

    [3/3]

  16. Again I had a look at a graphics library, this time only Qt. It has some good features, but since I want to implement everything (HTML, CSS; JavaScript if I want it at all) from scratch it doesn't make sense to use a high-level library that has it already implemented.

    So I'm back to SimpleDirectmediaLayer.

    [2/3]

  17. The HTML rendering part of my C++ HTTP client got a bit too messy, so I'm starting it again from nothing.

    This time no sockets, no network, no URLs, no parsing HTML, no fighting against C++ inheritance and order of construction, just rendering protoHTML in plain, good old C.

    [1/3]

  18. Since a few days ago I've been playing around with system calls in . I started in the direction of a TCP/IP6 echo, now I'm introducing ptrace.
    Works fine, the part that's implemented.

  19. A finite while loop succeded:
    var g := 5; while (g) g -= 1;
    I'm steadily moving forward.
    Next I'll fix my compiling which still doesn't support the 'if' conditional statement.

  20. Now I see that it's too hard to both execute and compile at the same time, so my is still in bits and pieces, but it slowly takes some shape.
    In the mean time I continue with the 'while' loop.

    in

  21. After an update of my laptop, the \l in /etc/issue started expanding to -, not ttyN.
    From the manual: agetty(8) accepts the port as a pathname relative to /dev or '-' for the current terminal.
    And using htop(1) I observe that aggetty is called as follows:
    /sbin/agetty -o -p -- \u --noclear - linux
    Probably '-p -- \u' is one argument

    So now I just need to convince systemd to give the terminal device name instead of '-'.
    Sigh

  22. I'm now reading and parsing 1 command line argument to get the size from the user.
    After playing around with time (I mean the buitin, haha), I think now, with I finally see the point of scattered/gathered I/O.
    It might even be convenient.

  23. This was just a silly error, I got confused and used a variable as both a table index and an iterator/subtable/pointer-to-subtable/pointer-to-element.

    is easy. Sometimes I get blocked by an error and it's hard to find it, but once it's fixed it goes on smoothly.
    Up to the next :)

    Here's what I've manages so far:
    Hanoi towers with a hardcoded size.

  24. Some :rust concepts I already like, some not yet, but with the book, docs, rustc --explain and my experience it's easy to learn.

  25. The write(2) system call returns -EFAULT (Bad address)

    Why do I need to check %rax even after outputing to a terminal?

  26. My was I loaded a 64bit register from 52(%rsp) instead of 56(%rsp).

    And since I have a little endian CPU and 48(%rsp) and 56(%rsp) were both below 2^32 the value was 2^32 times too big.

    How could I think that 52 is divisible by 8???
    I needed it to be prinited in hex as 0x34 by to notice it's not.

  27. I generated a SIGSEGV for my program by typing
    print (long long) 40($rsp)
    in

    Ok, I know I expected a near that point, and my code contains
    mov 40(%rsp), %rax
    but the SIGSEGV should be raised a few instructions after this movq, when dereferencing a derivative of this 40(%rsp) and at both points (this gdb print and the normal SIGSEGV point) the stack pointer looks ok.

  28. I'm returning to , this time GAS version, not Netwide, because I wanted to use gcc in front of as and ld. But whenever I reference a variable in .data I have a linking problem:

    relocation R_X86_64_32S against `.data' can not be used when making a PIE object; recompile with -fPIE

    So I'm using as and ld seperately.

    And I'm linking without glibc. Again

  29. I fixed converting base16 to base64, which is an obligatory step in the handshake. I thought it might have been a problem, but it was because I padded the intermediate base256 with 0s at the beginning, instead of at the end. But Firefox still rejects my server's response :(

  30. It was a lot of work to convert the std::vector to mmap(), but it's done now! Now I have a little problem with con/destruction, as is often the case in : when pushing smth to the stack I need to use the placement new:
    sp --; new (sp) Expression{...};
    Otherwise operator= tries to destruct the dummy-initialized std::string inside Expression.
    And also I need to destruct Expression if I don't want memory leaks from the constructed std::string.

  31. Should I use a kernel-handled memory arena for my language's stack now, or later?
    I will need it any way, when to .

    I mean using MAP_GROWSDOWN and MAP_STACK flags for mmap(2) syscall.

    [1/2]

  32. Local variables done!
    And also I'm entering the 3rd phase of my source structure: I'm breaking smaller, single-purpose functions out of my main loop. It makes the code clear and allowes to call these fcns from different parts of my program. And it's another step to make an interpreted language compilable... ;)

  33. The next thing in my interpreted language will be local variables, since the 'if' works. I can either leave the object definition on the interpreter's stack or have them defined outside the stack, associated with the block in which they're defined.

  34. @rmgr Nice. I'm also programming my language. It has classical in-order operations, so my stack is a bit more hidden from the user (ok, actually programmer), but still I love my stack. It solves all my problems and is both easier too use and more efficient than recursivity. Recursive solutions use the machine code stack which I can't control as much as the structure I've designed myself for this perticular purpose.
    Good luck! Have fun!