Hacker Newsnew | past | comments | ask | show | jobs | submit | sph's commentslogin

> I write mine all by hand. It's the easiest part of a compiler to write, by far. It's also the least troublesome.

It's also the most annoying if you're writing a new language. You want to iterate on its ideas, but can't do so until you have a parser done.

I've been designing a few language concepts over the past year, and it feels 80% of this time has been writing and debugging parsers; by the time I get to the meat of language design - the shape of its AST, the semantics of it - any small syntactic change means going back to update the lexer and parser stage. Doesn't help that I can't settle on a syntax.

BTW I first started with PEG, which are nice in theory, but I feel the separation of lexing and parsing stage to very helpful to reduce boilerplate (handling whitespace in PEG is obnoxious). Later, I hand-wrote my parsers (in C), but it's gotten so repetitive I've dedicated a weekend to just learning lex/yacc (actually flex/bison). Even if parsers are easy to write, it's good to have higher level tools to reduce the tedium of it.


There are other tools for prototyping the grammar for a new language. There are several online tools that can interactively parse input based on a given grammar. The one I developed is: https://fransfaase.github.io/MCH2022ParserWorkshop/IParseStu... The page does contain a sample grammar and sample input. For the grammar for the grammar see: https://fransfaase.github.io/MCH2022ParserWorkshop/index.htm...


Anecdotally, lex and yacc gets your prototype up and running quickly, but the ongoing adjustments needed winds up with it behind. The time lost comes from:

1. having to learn lex and yacc

2. running into limitations with lex and yacc

3. having a foreign program (i.e. lex and yacc) integrated into your build process

4. requiring a particular version of lex and yacc that may be awkward on multiple platforms

5. optimizing the code. (Once you start doing that, you cannot use lex/yacc to generate a new version.)

And so on.

At one point, we decided to write a D program that built the D compiler, instead of using make. Well, that turned out to be a greater time sink than just using make.


  > You want to iterate on its ideas, but can't do so until you have a parser done.
Embed your language into host language. It is simple to do even in C++.

Iterate on ideas till your heart content, then add syntax.


Alternatively (or concurrently) use s-expressions and add syntactic sugar later.


The thing that bugs me to no end when talking about inflation in an historical context, is that everyone forgets to consider how the indexes of consumption it's calculated from (PCEPI, CPI, etc.) are NOT static, and very arbitrarily are changed over time, often to make inflation seem lower than it actually is for the consumer.

Overall, historical comparisons of inflation numbers are so imprecise to be practically worthless the longer the timescale. You can expect the real figure to be much greater in reality for consumers, given the political incentive to lie over inflation data.


Artistically cool, but squirrel brain is nothing like this "psychedelic" experience.

Lack of motivation and focus is pretty easy to imagine for anybody, as it's a common sentiment; the only difference, medically, is whether it happens often enough to cause issues in your day-to-day life. You can easily replicate this yourself, neurodivergent or not, with bad sleep, junk sugary food, doomscrolling on TikTok/YouTube for the entire day and see whether you have the motivation or focus to do anything. Unmedicated ADHD feels a bit like having that most days.

Source: I am diagnosed ADHD. I don't take dexamfetamine any more because it's far too "synthetic" for my tastes and it feels like being a cart pulled around by a horse. For the past year I've been using nicotine patches and in my experience they work and feel better than any amfetamine treatment. I am also starting to believe the so-called "ADHD craze" is just a widespread epidemic of dopamine depletion caused by social media and modern technology in general.


Thanks for your comment. Yeah, I posted it mainly because I liked the artistic side of it - the landing itself is quite complicated (a lot of interactions), but I really enjoyed the creativity.

I'm also diagnosed with ADHD. Unfortunately, there are no ADHD meds available in my country at all. :(

I'm not exactly sure what ADHD feels like for me, but there’s one thing I’ve noticed. I used to take methylphenidate, but the effect was pretty small. In order to get it, I had to fly to another country, which was expensive. So I eventually gave up on that idea.

Now it’s been a year without stimulants, and I’m not sure if it’s a coincidence or not, but for the first time in my life I’ve ended up in debt, with almost zero productivity, no finished projects, and so on.

It doesn’t matter whether I sleep well or not — over the past 12 months I’ve had different conditions (good sleep, bad sleep, good diet, bad diet, etc.), but overall, my focus has stayed close to zero.

By the way, I’ve never tried nicotine patches. I’m pretty sure I won’t find them here, but at least I can probably order them.


Where I live now there are pretty much no ADHD meds either, but I wouldn’t have moved here (for a better quality of life in general) if I didn’t have nicotine patches to keep me going. I order them on eBay because they are 4x as expensive in pharmacies here compared to other european countries. Start with a low dose (you can cut them). 7.5mg worked well for over a year, now I’m increasing it to 12mg. If never abused, neither amfetamine nor nicotine patches have great addiction potential ( I used to smoke a pack a day for 10+ years). It’s good to take a day off once in a while.

What I also require to function is a low carb diet, and pretty much no added sugars. Carbs destroy my mood, sugar is powdered ADHD, whereas protein and fats keep my brain silent. Lately I’ve been experimenting with tyrosine (a supplement of natural aminoacid found in many foods such as cheese) which gives me a bit the laser like focus of AMPH, and a minor crash in the evening. I use it sparingly but it’s good to have and very cheap.

Hope some of this helps. Email in the profile if you have more questions.


> The problem is that everyone is doing their own thing instead of coming up with a common standard

I mean, there is a reason XKCD 927 is the most quoted to the point of attracting downvotes. It's pure cliché, so I wonder why you believe a common standard to rule them all is possible.

There is only one sane approach in software: opinionated configuration. Yet the free-software world somehow still clings to the utopia of multiple, freely interchangeable choices, and all you get is half a dozen unmaintained backends and just one that actually works for a number of years when someone forgets 927 and decides to reinvent the wheel, badly.


I have yet to hear an argument against systemd which isn’t a variation of:

- """bloat"""

- I dislike Poettering. Remember pulseaudio?

- a core user-space layer for modern applications that can’t only rely on the spartan kernel syscall API? Literally 1984.

Given that systemd is good enough and is running on 99% of desktops and servers, I always find it hilarious to see how the vocal minority is overrepresented on this forum.


There aren't decent Pro systemd arguments other than "the Linux API confused me" and sysv init (which no one argues is good) was bad.

Personally the last system I had systemd on corrupted my package database after killing apt that I was running in tmux. "Oh you can fix that with xyz systemd configuration." Here's my response:

Kindly shove it up your ass and quit moving things around all the time just because you're board.

Also if "it's good enough for most people" is a decent argument then you should be on Windows.


The pro argument is that writing shell scripts for starting/restarting/enabling/disabling/stopping is total garbage. Not to mention having to manage lock files. systemd units are not perfect, but they are a billion times better than the crap we used to deal with.


Wow, neither of you actually read my comment.


The pro part is the massive simplification and security advantages systemd brings to plain and simple config files. Sure, I can reimplement the containerisation API in OpenRC if I stack enough helper binaries and shell script libraries in there, but I don't want to. Kindly shove it up your ass and quit moving things around all the time just because you're board.

If it's good enough for most people, that means it's good enough to use as a basis for development. The same way no company develops mobile apps for Phosh or Plasma Mobile: the tiny fraction of people who have more esoteric preferences aren't worth rewriting the software stack for. Those who don't like the status quo can write their own wrappers and hacks if they want to use your software.


It is weird to name something as a "massive simplification" when saying that it is intended to replace "plain and simple config files". "Massive simplification" is a term that may be applied to something like the daemontools of Bernstein and to other systems inspired by it, but certainly not to anything based on systemd, where it is much harder to discover what it really does, when problems appear.

Perhaps systemd has "security advantages" over alternative solutions, but I have never heard of them and I cannot imagine them, so please name them.


Honestly this sounds like an apt problem. A properly robust package management system shouldn't be able to succumb to such a problem.

Your abrasiveness is not helping discussion. I'm also not a board.


So your software broke my machine then you tell me it's my problem and wonder why people are angry and frustrated with you?

Do you see why most competent people's reaction is to just use something else? systemd might even be technically superior but the maintainers are such assholes it's not worth it.


I believe that the opposite applies.

I have yet to hear any argument pro systemd that is valid.

As long as the systemd supporters cannot explain its advantages, there is no reason for anybody else to replace their good systems that work fine without systemd, with systems using systemd.

In practice, systemd has been imposed by force. The developers of a few packages, like GNOME, have introduced dependencies upon systemd. Then the maintainers of the major Linux distributions have considered that such packages cannot be removed from their distribution, therefore they must base it on systemd.

Then the users have discovered when upgrading their computers that they must either migrate to systemd or stay with their ancient program versions.

This is how systemd has propagated. In no place there was any analysis about technical advantages and any attempt to find an optimal solution by consensus.


> As long as the systemd supporters cannot explain its advantages, there is no reason for anybody else to replace their good systems that work fine without systemd, with systems using systemd.

Assuming you know what systemd as init system able to do, I'm not sure what extra information you need for getting list of advantages.

If you going with examples is better for you, i'll mention couple of mine - note that I likely forget some other good samples as it's so natural so I'm may be not realizing it's systemd's feature, just "how things work"

* hardening - syscall filtering, privilege limiting, read/write path filtering, per-unit tmp files. As nice example, I have great peace of mind when I put php-fpm into network isolated to localhost only for IP level

* resource management and resource information at all - observing resource usage by multiple units when needed with a quick way saves my time, in addition to being able to collect such metrics into monitoring. Setting the lowest IO priority for backup scripts and even MB/sec per block device - godsend. Limits on CPU usage or RAM usage where needed ensures smooth operations of the fleet without nasty surprises

* things like quick overview with systemctl --failed, user-level units instead of flacky @reboot in crontab (yeah, we still remember it from eggdrop/psybnc days)

* clear and uniform way to work with services across the team, no hacky bash scripts with saving PIDs

so on.

Probably you do system administration for your servers in some other way that all that goodies are not noticeable for you and your team.


> I always find it hilarious to see how the vocal minority is overrepresented on this forum.

Those who oppose the norm are usually a lot more vocal than the people who support it, or just don't care. This is why you get bathtub curves in ratings - you can bet the low ratings are over-represented in comparison with the meh and the praise.


[flagged]


During Microsoft's most recent shareholder meeting the CEO actually bragged about spamming HN and successfully getting people to use Azure that way. I wouldn't be surprised if they were at least partly behind the big systemd/gnome pushes.


It's a lie. Here is a verbatim transcript and you'll find that there was no mention of Hacker News whatsoever or anything close to that:

https://www.microsoft.com/en-us/investor/events/fy-2025/2024...


Do you have a link? That sounds like an interesting story on its own.


I take offense at being called an IBM/MSFT shillbot just because I have a different opinion than yours. Learn how to voice disagreement without resorting to passive aggressive 4chan snark.

And feel free to produce evidence that non-systemd Linux users are not a minority.


[flagged]


> The majority of people are demonstrably idiotic

True. But is any minority of people demonstrably smarter?

I have been asking for good argument against systemd, and all I have gotten is name-calling and "we're few so we're better than you". I honestly don't care at this point, good day.


the reason any libre alternative is better than systemd is they are not beholden to IBM or Microsoft


For all in this context does not mean “all the infinite combinations of software for people that refuse to adopt the status quo”

systemd is here to stay. It is ludicrous to imagine everybody to keep supporting that 1% that is ideologically opposed to it, no? As those people love to say, open-source is written by volunteers, you can always fork it.


What about the (admittedly small) % of operating systems that can't support systemd, like FreeBSD? systemd is pretty heavily dependent on Linux, and that's not an ideological thing.


Does gnome officially support non Linux kernels? It's possible to implement the systemd APIs gnome is taking dependencies on without strictly using systemd itself.


I am pretty sure 50% of my search results on Kagi (or Google or Bing) are LLM-generated. You can search anything and find a dozen websites that, surprise, have a page dedicated exactly to that topic, organized in three or four neat sections.

The internet is dead and is starting to smell.


Google: ruining their core product for that sweet ad money.


Ads are Google's core product, isn't it?


Google's core product has always been advertisement. They sell advertisements to companies looking to advertise, and they bring in tens of billions in revenue from that business. In effect, their core product is you: they're selling your eyeballs.

If the bait that they used to bring you to them so they could sell your eyeballs has finally started to rot and stink, then why do people continue to be attracted by it? You claim they've ruined their core product, but it still works as intended, never mind that you've confused what their products actually are.


Their core product is software meant to make sweet ad money.


I have the same issue. Every time I feel I want to get better at C++ and learn what changed in the past 2 decades, I also have to contend with the fact that I'll have to learn cmake, that package management is non-existent, that compile times are atrocious and let's not forget the whole template abomination.

The day I need the performance and guarantees C++ can give me is the day I'll dive deep into Rust instead.


There are cracked Denuvo games, and no anti-piracy scheme is unbreakable, ever.

If it can run on your PC when copy-protected, it means at some point the CPU executed the right instructions, so a crack is always possible to create. It's just a matter of how much effort and time is it to reverse-engineer it. You cannot copy-protect software indefinitely.

I remember feeling cool as fuck as a teenager because I cracked GTA 3 by dumping the live memory of the binary post decryption. Of course it's been 25 years, so the status quo has improved by a lot and god knows how many man-years and kWh are wasted on copy protection.


Technically some CPUs support secure enclaves that should support end to end encryption which should be robust short of lifting the encryption keys from the die. In practice things like SGX have been full of holes.


Even assuming those are flawless, lifting keys is still O(n) in the key size, and the battle is just increasing the constant factor enough to make it unattractive. The problem is that lifting keys is attractive for reasons much more valuable than game cracking, so after a few years they should always be assumed compromised.


X-box is unbreakable.


So was the PS3, until it wasn’t.


but afaik, we still don't have a break on xbox one released 2013 - 12 years later.


I love this presentation by a Microsoft person on the security aspects of the Xbox One: https://www.youtube.com/watch?v=U7VwtOrwceo


Perhaps it's just that xbox is irrelevant, when you have PC and Playstation?

To me, Xbox is that video-game you get when you ask for a Playstation and your parents don't understand video-games. Their versioning scheme even helps make sure the parents fail to purchase the latest generation.


The two main things that people jailbreak consoles for are dumping games to emulate on PC and running homebrew. Microsoft explicitly supports the latter use case with Dev mode and for all but a couple games (only Halo 5 nowadays?) explicitly supports the former use case by releasing their games on Steam and skipping the emulation bits. So there is little interest in hacking the Xbox consoles now. Yet I think someone still has managed in the past year to get decrypted game dumps from both XOne and Series X.


there has been one recently that led to the dumping of games on xbox one and série and the beginning of emulation projects


To be fair, it has no games either.


people lost interest in hacking the xbox after dev mode was introduced to run custom apps


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: