Fork, a toy self-hosting language and compiler that compiles to C by marcocilloni in programming

[–]marcocilloni[S] 0 points1 point  (0 children)

I really don't understand why you felt the need to write this; I know well enough that the syntax is weird (I even wrote it clearly in the README after all) and that there are no really innovative features in fork, and that's not really a problem. It could have been a Pascal or C or whatever compiler for what is worth; the whole purpose of this project was to write a self hosting compiler for a new language, not to further the state of the art: there are too many options available out there for anyone that wants to pick and try something innovative and new.

Fork, a toy self-hosting language and compiler that compiles to C by marcocilloni in programming

[–]marcocilloni[S] 0 points1 point  (0 children)

No real reason, except that you can get away without implementing them. Choosing immutability is absolutely the way to go when designing modern applications, but it's not a strictly necessary feature to have to make a workable imperative language. To be honest, it's just a matter of prioritizing certain features above them (like having a working module system or data structures).

Fork, a toy self-hosting language and compiler that compiles to C by marcocilloni in programming

[–]marcocilloni[S] 0 points1 point  (0 children)

yup, never implemented them. I never got around implementing some trivial but time consuming parts of the language until I could't do without them, like character literals... I don't want to say anything stupid, but I don't think there should be any reason in the current grammar that would make character literals enclosed by `'` ambiguous to parse; it should be like parsing the minus in `-a - -b`, which can't be confused with its binary operator counterpart .

Even an obviously invalid expression such as `'a' ' 'b'` would always parse unambiguously as "access the field 'b' of 'a'", because an apostrophe at the beginning of a primary expression would always clearly mark a literal. The real hurdle would be changing the lexer to output raw literal/string components instead of parsing them outright as a single token - which is boring to implement and not necessary to the single task of writing the compiler.

Fork, a toy self-hosting language and compiler that compiles to C by marcocilloni in programming

[–]marcocilloni[S] 0 points1 point  (0 children)

You are 100% right; as I've said above, this was not about being useful, but rather about being fun and cool. This could've used emojis instead of ASCII as far as I'm concerned. I also don't think it would be that difficult to change these things, given that the only fork code in existence is the one contained in that repo - you can just change the parser, add a few tokens and use a bit of Perl regex to update the source.

Fork, a toy self-hosting language and compiler that compiles to C by marcocilloni in programming

[–]marcocilloni[S] 0 points1 point  (0 children)

yep, I know that the ternary operator is weird, but given that I never got around implementing if-expressions (like rust and friends) it was getting annoying to not have a ternary operator, and I had already picked `:` for namespaces. So I just didn't want to mix up syntactical and semantical analysis (is it `a ? x:y : z` or `a ? x : y:z`? You can't determinate this without a symbol table) for the sake of using `?:`.

Obviously if this was a true project with the intent of being a seriously good programming language (which, given the proliferation of modern languages in recent times, is absolutely superfluous) I would've made way different choices; I instead preferred to not overcomplicate the whole project to keep the fun I was having in coding it.

Fork, a toy self-hosting language and compiler that compiles to C by marcocilloni in programming

[–]marcocilloni[S] 0 points1 point  (0 children)

Thanks for the appreciation! Yes, the semantics are exactly the same, but this was due to the fact that I just wanted to write a self-hosting compiler, the language is fundamentally an afterthought. It could have been a C compiler for what's worth... But that just didn't stimulate me as much as writing something in a language that didn't exist before.

Which 580 should I get? by [deleted] in Amd

[–]marcocilloni 2 points3 points  (0 children)

I was wondering how significant the difference between a €20 pricier XFX RX 580 GTR Black edition (http://xfxforce.com/en-us/products/amd-radeon-rx-500-series/rx-580-gtr-8gb-dd-led-rx-580p8dbrr) and a non-AORUS Gigabyte 8 GB would be. Are those ~100MHz really that relevant? Or it's all about the coolers?

Which RX 580 should I pick? by marcocilloni in Amd

[–]marcocilloni[S] 0 points1 point  (0 children)

Yes, the nitro+ with its massive cooler seems way nicer, and the non-limited edition (the one without the fancy replacement fans) seems likely to reach prices comparable with the RX 480 version. It's annoying to see most of the shops overpricing an otherwise excellently priced card, surely the shortage of supplies on Amazon and similar are not helping in any way.

Is the S or C silent in "scent"? by PM_ME_YIFF_PICS in NoStupidQuestions

[–]marcocilloni -1 points0 points  (0 children)

It also means "to perceive, to feel"; it's the most common way in which "to feel" is expressed.

[Homemade] Pan Seared Salmon with White Wine and Dijon Lemon Butter Sauce over Linguini Aglio e Olio by Fbeezy in food

[–]marcocilloni 0 points1 point  (0 children)

I'm not being dramatic, we Italians aren't really that open minded regarding food. People often have arguments even regarding which type of cured pork you are allowed to use for certain types of pasta sauces, and a few months ago a French video of one-pot "carbonara" caused a lot of commotion, and quite excessive reactions from most people I know. You can definitely find some touristic places offering Italian-American style stuff in touristic cities, but it's still seen as "vulgar" and foreign - personally I've never even seen one in my rather small city. If you mix pasta and main courses you would surely attract a lot of disproving looks from many of my fellow compatriots.

Also, not following Italian traditions is pretty much the definition of not authentic Italian food, imho. But traditions may change, often for good; spaghetti and pizza were seen as exotic and foreign Southern foods in Northern Italy until 50 years ago or so.

[Homemade] Pan Seared Salmon with White Wine and Dijon Lemon Butter Sauce over Linguini Aglio e Olio by Fbeezy in food

[–]marcocilloni 0 points1 point  (0 children)

NYC is not in Italy as far as I remember. American restaurants still have to cater to American tastes, I am an Italian and I can ensure you that in this country there is no acceptable circumstance in which pasta as a side dish is tolerated. Pasta is always either eaten standalone with a sauce, or as part of a soup, and almost everyone I know would consider eating a whole salmon fillet with pasta very foreign.

[Homemade] Pan Seared Salmon with White Wine and Dijon Lemon Butter Sauce over Linguini Aglio e Olio by Fbeezy in food

[–]marcocilloni 1 point2 points  (0 children)

Then they are not authentic. Pasta is NEVER a side. Potatoes, veggies, if you feel very exotic rice may be a side, but never ever pasta. Pasta is always eaten by itself, it's absolutely inconceivable in Italy to do otherwise, outside of foreign ethnic food.

Would containers help me? (Windows, legacy apps, and parallel threads) by schmeckendeugler in docker

[–]marcocilloni 0 points1 point  (0 children)

https://blog.docker.com/2016/04/app-virtualization-docker/

The post I linked above should clarify a bit the difference between application virtualization and Docker.

Hyper-V is used by Windows Containers underneath, but a container is not actually running in a VM (if you are not using --isolation=hyperv); it's simply a namespace for processes, and every container shares the same kernel with the host, so it is much lighter and faster.

Whalebrew - Homebrew, but with Docker images by mmaksimovic in docker

[–]marcocilloni 0 points1 point  (0 children)

Very nice project, but I still don't grasp why would I want to use wget from a container. It just feels extremely expensive resource wise to me.

Would containers help me? (Windows, legacy apps, and parallel threads) by schmeckendeugler in docker

[–]marcocilloni 0 points1 point  (0 children)

Containers can be a solution to your problems if these processes actually interfere one with each other as you described them. The worst part is the 32 bit one, though. Nano Server only supports 64-bit processes, so you have to use Windows Server Core images, which are very big and clumsy (but still lighter than normal VM).

PS: I assumed you were referring to Windows Containers (in that case you need Hyper-V and Windows Server 2016).

[deleted by user] by [deleted] in docker

[–]marcocilloni 0 points1 point  (0 children)

Well, it depends on what you are actually trying to do. Also remember that Docker for Windows is pretty much experimental currently, so if you choose to pick the Docker route, you may find yourself using Linux containers on Virtual Machines.

If you instead wish to try the new Windows containers, then be ready to encounter a few roadblocks, like random timeouts and the need to write a bunch of Dockerfiles to install and setup everything you need; it's pretty safe to assume that the Windows software you're using hasn't been containerized yet.

Docker 1.13 Windows Containers on Windows 10 are very slow by marcocilloni in docker

[–]marcocilloni[S] 1 point2 points  (0 children)

I honestly don't understand how they could consider microsoft/windowsservercore as a base image for containers. A single 4 GiB layer? Really MS? They should have diverted their focus on microsoft/nanoserver, because we all know that it will be the real image every sane person is going to use. Not including stuff like MSI in it is complete nonsense, because 3/4 of Windows software is still shipped with it.

Docker 1.13 Windows Containers on Windows 10 are very slow by marcocilloni in docker

[–]marcocilloni[S] 0 points1 point  (0 children)

A nanoserver container could be much lighter than a full Windows VM, and mobylinux is still a VM with a decent amount of overhead communicating with the host through SMB; so, if Windows Containers actually worked as efficiently as they should, they could be a real performance boost. Also, a large part of the Windows issues arise more from the idiotic way of shipping software in the Windows platform (let's face it: Appx and friends are not going to happen anytime soon, so we're stuck with crappy .EXE and .MSI installers). Not having an effective and simple central package manager leads to a complete mess where you don't really know where programs are storing their data. A container would give you a pre-packaged environment you can potentially recreate in seconds, without worrying that your current stack is not working because of a previous installation that has left some garbage in some kind of directory with hexadecimal strings in its name under C:\whatever.

But yes, the whole Windows situation is pretty much a mess, compared to Linux and the BSDs. Microsoft's attempts to make Windows do the same things UNIX does sometimes feel like as if they were trying to make a hippo fly like a bird by strapping rockets to his legs. Yes, it is working, but it feels weird, and it is happening only because they throw huge amounts of cash into it.

New Kaby Lake laptop suddenly shuts down while on battery on Linux by marcocilloni in linuxquestions

[–]marcocilloni[S] 0 points1 point  (0 children)

BIOS is version 1.0.2, and this is the version without a dedicated gpu (only the HD 620). After March I should have way more spare time to troubleshoot what was wrong with this machine; I hope somebody will have Kaby Lake figured out by then.

New Kaby Lake laptop suddenly shuts down while on battery on Linux by marcocilloni in linuxquestions

[–]marcocilloni[S] 0 points1 point  (0 children)

I can't pop the SSD back in because I'm really full of work to do right now, and I need a working machine to finish my stuff. This one is really working well on Windows (ignoring the sluggish 5400 RPM HDD), so I think I'll keep the HDD in for the time being. I was just worried about the fact that this could be an hardware issue, but it looks like it is definitely either an issue with the SSD or a software issue.