11 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

9 comments

  1. [3]
    Apos
    Link
    I'm working through this book right now: Compiling to Assembly from Scratch. It's really fun. It reminds me quite a lot of Let's Build a Compiler. My goal is to implement a first compiler for my...

    I'm working through this book right now: Compiling to Assembly from Scratch. It's really fun. It reminds me quite a lot of Let's Build a Compiler.

    My goal is to implement a first compiler for my Vyne language: https://github.com/Apostolique/Vyne-Language.

    5 votes
    1. [2]
      unknown user
      Link Parent
      Vyne is quite interesting. Lots of features, from the brief look. Nested comments is of particular curiosity to me. What motivated you to make that part of the language? What do you see as this...

      Vyne is quite interesting. Lots of features, from the brief look.

      Nested comments is of particular curiosity to me. What motivated you to make that part of the language? What do you see as this part's purpose?

      3 votes
      1. Apos
        (edited )
        Link Parent
        I originally wrote a compiler back in 2012. The reason back then was because I could and I thought it was cool. Nowadays, I feel like it's best to not use multi-line comments. They are pretty...

        I originally wrote a compiler back in 2012. The reason back then was because I could and I thought it was cool.

        Nowadays, I feel like it's best to not use multi-line comments. They are pretty annoying to deal with. I think it's better to multi-line comment with a series of single line comments. IDEs also allow you to select all the lines you want to toggle them.

        Multi-line comments are pretty nice while debugging though. You can have a line with one in the middle:

        console.log(/*"Hello"*/"World");
        

        Or even better, use it to toggle code in a single location:

        console.log(/*"Hello " + /**/"World");
        console.log("Hello " + /**/"World");
        

        Nesting is nice when you already have a multi-line comment in a code block and you want to comment out more.

        /*
        console.log(/*"Hello"*/"World"); // Broken
        */
        

        Right now, there are some languages that support it like ASN.1, Kotlin, OCaml, Rust:

        /*
            This is inside the comment
            /*
                You can insert something here.
            */
            This is a comment since the nested comment is parsed correctly.
        */
        

        OCaml even went pretty far and parsed comments in strings so this case doesn't break (Looks like Tildes' syntax highlighter doesn't handle that case.):

        (* don't want x for now
        (* 
        nested comment
        *)
        let x = 1;;
        let y = "*)";;
        *)
        let z = 1;;
        

        They also handle a bunch of other edge cases.

        It's a pretty big can of worm.

        Recently, I introduced a way to comment code without using a comment. It might be better to use that instead:

        ~{
            // Some code.
            // It will never be executed.
        }
        

        Looks like I didn't fully respond to the comment: The real original reason was that it made sense. Why shouldn't something be nested? I saw it as just something that made sense.

        Nowadays, I'm mostly conflicted.

        2 votes
  2. krumpinjugger
    Link
    I've been working on a digital-to-analog converter (DAC) prototype as part of university research. The research is on a method of distortion reduction using a non-typical type of dithering, and...

    I've been working on a digital-to-analog converter (DAC) prototype as part of university research. The research is on a method of distortion reduction using a non-typical type of dithering, and the prototype may possibly achieve distortion levels lower than any commercial DAC has ever been able to achieve. The implementation has been tough but very personally rewarding, because it requires a lot of embedded linux knowledge, FPGA programming in VHDL, and some pretty brutal high frequency circuit design.

    5 votes
  3. rkallos
    Link
    I've been working on a server for the Gemini protocol and a small wiki built on top of it. I'm writing them both in Erlang.

    I've been working on a server for the Gemini protocol and a small wiki built on top of it. I'm writing them both in Erlang.

    5 votes
  4. [2]
    grungegun
    Link
    OK, I'm gong to ask a question. Is the LAMP configuration for a web server scaleable? If so, how? If not, how can it be made scaleable?

    OK, I'm gong to ask a question.

    Is the LAMP configuration for a web server scaleable? If so, how? If not, how can it be made scaleable?

    3 votes
    1. archevel
      Link Parent
      As with everything interesting the answer is it depends. Can you spin up new instances of the web server and have them do work independently or is there a need for some synchronization between...

      As with everything interesting the answer is it depends. Can you spin up new instances of the web server and have them do work independently or is there a need for some synchronization between running instances? If each web server is completely independent then the setup could be scaled horizontally indefinitely.

      More interesting might be to consider how scalable you need your solution to be. It is fairly easy to scale things vertically by just running things on a bigger machine. Then again you might not want to pay for that continually if your workload isn't uniform.

      Scalability is usually something you don't need to worry too much about when you start a project. It is a nice problem to have later on since if you run into it as a problem it means you have some usage already and can probably afford to solve it by scaling up the server initially. That said, it doesn't hurt to ponder it a bit, at least so you don't paint yourself into a corner by having centralised locking of some resource or similar...

      3 votes
  5. mftrhu
    Link
    I was hacking up a Gemini server in Racket. It's a surprisingly productive language, even if the manual could stand having some more examples.

    I was hacking up a Gemini server in Racket. It's a surprisingly productive language, even if the manual could stand having some more examples.

    2 votes
  6. kari
    Link
    I've been working on my Python script to help manage my dot file repo that I mentioned last week. I've just been trying to add features that seem like they could be useful to me at some point and...

    I've been working on my Python script to help manage my dot file repo that I mentioned last week. I've just been trying to add features that seem like they could be useful to me at some point and I've also added it to PyPi and the AUR :)

    During my internship I've been working on writing a test case to benchmark smb transfer performance over the company's packet inspection boxes. That's a bit less fun but it's still programming so honestly good enough for me haha

    1 vote