Skip Navigation

Posts
7
Comments
126
Joined
3 yr. ago

Engineer and coder that likes memes.

  • Makes sense, I feel bad for the guys that were happy for a chance and got screwed over. (By the hackers, not you, haha)

  • That's a bad take. Unless you get your knowledge purely from shady tutorials or have a fast track bootcamp education, it's unlikely you never touch on security basics.

    I'm a software design undergrad and had to take IT Sec classes. Other profs also touched on how to safely handle dependencies and such.

    While IT Security is its own specialisation, blindly trusting source code others provide you with is something a good programmer shouldn't do.

    If you need a metaphor: Just because a woodworker specialises in tables, doesn't mean they can't build a chair.

    Edit: Seems like my take is the bad one 😂

  • It's sad that this works. You'd think especially software professionals would be the most vigilant about running unknown code.

  • Semi related: There's a cool rabbit hole you can dive into when it comes to coastline lengths of some countries. Specifically the UK.

    Depending on who measured the coastline and with which method the results can be wildly different because there's always some form of simplification required. See this video for example: Link

  • That's why he's not worried about stuff running out

  • You could probably get that tent and all other equipment you need for touring, including the e-bike, and still have enough money leftover to throw a huge celebration party with all your friends for your smart financial decisions.

  • The group I referenced had a paid membership. Scale that up and make it digital and you may end up with a gender exclusive social media app.

    I get what you mean though, but I feel there's a bit more nuance than what you imply.

  • While I certainly agree with you that discrimination based on sex is unacceptable im most contexts, I believe that gender exclusive spaces, unless they hinder people directly, sometimes are a good thing.

    My dad is a mental health professional and founded a weekly 'only-men' self help group. He found that some things they talked about there wouldn't have worked with women involved. That group existed for about 5 years or so and helped quite a few struggling men.

    So yeah, unless there's any maliciousness involved, I'd argue that gender exclusiity is not bad in every context.

  • It doesn't compile or transpile in actuality. It generates Java based on an abstract syntax tree. The concrete syntax is not considered in Java generation by MPS.

  • Because it was easier to use Java primitives than implement the constants myself.

  • MPS uses projectional editing. Which means for the user that everything you do is free from concrete syntax, and you basically edit a graphical representation of that abstract syntax tree directly, while it looks like you're in a textual editor.

    So I define abstract nodes that may have certain relationships with each other and then give them a representation in the editor (which is what you see in the screenshot). These nodes may also have generators assigned to them, which use map/reduce operations to generate whatever source code I desire. It usually includes its own bit of code, and triggers code generation of its children as well.

    I hope that was somehow clear 😄

  • Great idea if I have to extend it

  • I like the way you think! 😂

  • Yes, it pretty much just wraps the expression in a "System.out.println(

    <expression>

    );"

  • Fortunately I generate Java source code from it. However MPS generates both source and byte code when you build the solution. For some reason I can't get the byte code to run though, but the source code does, so I don't care too much.

  • Very cool, I'd be interested in your publications once you're done. I like metaprogramming, but once you realise you might have needed it, you're already knee deep in fresh legacy code.

  • Valuable input! I actually am an undergrad student. There are a lot of frameworks out there that support writing languages, with MPS being one of them.

    If I'd start from scratch again and had a little more time, I'd frankly try writing an interpreter myself, instead of trying to conform to weird framework syntax, which I won't be able to reuse in any other context.

    Saying syntax design is fiddly is an understatement. I focused very hard on getting an abstract syntax somehow finished before working on generation in my first iteration. Then I had so much technical debt, that I couldn't get anything to work and had to rewrite a lot. So I scrapped it all and started again, starting with top level concepts including generation and only implementing some lower level ones, once everything around it worked properly.

  • You're correct, but it doesn't really matter for demo purposes. In an actual use case (whatever that would be for this language) you would of course want to use some kind of variable or expression there instead of a constant.

  • It's a tool for designing domain specific languages. Really interesting!