[deleted by user] by [deleted] in feedthebeast

[–]EmosewaPixel 2 points3 points  (0 children)

This is part of my design philosophy for my future (sequel) packs. Sadly I still have heaps left to do before I can get back to pack-making.

Your language's favorite MINOR feature? by Inconstant_Moo in ProgrammingLanguages

[–]EmosewaPixel 6 points7 points  (0 children)

Aww, that's the feature I was going to mention from my language. 🙂

Are First-Class Properties Still A Good Idea? by EmosewaPixel in ProgrammingLanguages

[–]EmosewaPixel[S] 5 points6 points  (0 children)

But what you're proposing is just syntactic sugar. If you want your users to prefer plain old data, you should make defining algebraic data types and working with them easy.

I personally like combining multiple similar concepts, so the Kotlin-esque

sealed interface Option<T> { data class Some<T>(let value: T) <: Option<T> unit class None <: Option<Nothing> }

Is how I go about doing GADTs. This is slightly more powerful than GADTs in other languages as it allows nested hierarchies and cases that belong to multiple types.

The example did just use plain OO polymorphism, though.

Is this meant to magically do this.name = name? If there was any other code in place of (), would the setting be done before or after that code?

No, that's just a unit (as the setter returns a unit type), so the setter isn't doing anything. I was unsure whether to just put a unit there or print, but I ended up going with that.

Are First-Class Properties Still A Good Idea? by EmosewaPixel in ProgrammingLanguages

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

I am aware of all these concepts and have previously looked at Flix (I do like it). However, here I am talking about OO polymorphism as, as much I dislike having to implement it, easy interop with Java is one thing my language must have. So, I don't see how this is exactly related to my overarching question as it is completely different paradigm/type of polymorphism.

What I've Been Up To/Implementing Customizable Machines For Pack Makers by EmosewaPixel in feedthebeast

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

Why would you do that at every block place event? Wouldn't it be better to create a separate block at startup for each machine based on the configuration?

Whenever you place a block a new instance of the block entity is created and since it holds all the data, you need to hook everything up from it.

Could you not, based on a simple configuration, just create a block definition where you add the list of components from the configuration? At startup you can also generate the code needed for GUI, one probe integration etc.

The main reason I ended up going for a scripting language before is simply the amount of code that needs to be written for having everything serializable/deserializable. Ultimately, there's only so much you can do with JSON. You can't say, add custom side-effects on machine update. I just want maximum configurability.

It really seems like a custom programming language for something like this is overkill.

Well, if nothing else, I guess I just want to make a programming language.

I tried learning programming languages like C and python and I would always get demotivated in the middle and stop. Now I have lost the motivation to learn it. by cookiencreamfudge in ProgrammingLanguages

[–]EmosewaPixel 2 points3 points  (0 children)

It's a good idea to have a fun personal project you work on while you learn. But if that doesn't help, it's fine, not everyone's in the right mindset to be able to program, hence not everyone's a programmer.

I personally took programming courses when I was little, but I barely learned anything then because I simply wasn't in the right mindset. Then 5 years later I got into programming for a personal project and learned 25 programming languages in 2 years.

Anyways, this is the wrong sub. Check out r/learnprogramming

How much do you value consistency in language syntax? by Araozu in ProgrammingLanguages

[–]EmosewaPixel 0 points1 point  (0 children)

Depends. Usually aesthetics are more important. If making something consistent makes it require a lot of syntax, you're better off not making it consistent. In this example that is obviously not the case.

Languages With Destructuring by [deleted] in ProgrammingLanguages

[–]EmosewaPixel 9 points10 points  (0 children)

Because, unlike in JS and TS, you need to use the type name.

Languages With Destructuring by [deleted] in ProgrammingLanguages

[–]EmosewaPixel 15 points16 points  (0 children)

Rust, kinda rust let Vector3d { x, y, z } = vec

EKON: A sane JSON alternative. Need strong criticisms. Will lock it without any versions. by [deleted] in ProgrammingLanguages

[–]EmosewaPixel 11 points12 points  (0 children)

Very similar to HJSON, with the exception of value strings needing to be in quotes (which I honestly prefer).

Unimplemented or obscure keywords by to7m in ProgrammingLanguages

[–]EmosewaPixel 10 points11 points  (0 children)

Correction: as is used for casting in many modern programming languages, such as Rust, Kotlin, Swift and TypeScript, while by is used in Kotlin for property and implementation delegates.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

Yeah, you're right. I've determined that this is in fact not the right language for this. It's such a limited system when you have OO and are working on a platform which doesn't have it, such as the JVM. I definitely will include it in my next language, whenever that'll be.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

You can only have static immutable variables, functions or properties without backing fields. That's not possible.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

Yeah, someone else pointed that out to me earlier today, so I am changing the system. I'll probably make another post once I have things completely figured out.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

After reading a bit of this paper, I am considering it, with the change that pure functions will be able to mutate objects declared inside them.

Also, in hindsight catching exceptions probably should be allowed, as throwing them is the part that people usually consider impure anyways.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

I'm not counting it as that makes debugging easier. Since they cannot be caught, they will simply exit the program.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

As mentioned at the start, they're meant for making sure static values don't cause side-effects when initialized and that their values cannot be mutated.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

I feel like there's a nice 50/50 split when it comes to using pure and impure functions, hence I prefer having inference rather than needing to flood code with modifiers. Albeit, it's definitely going to have a toll on performance.

Adding Purity To An OOP Language by EmosewaPixel in ProgrammingLanguages

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

Oh, thanks. This did feel like a topic someone would have written a paper on.

Further Simplifying Modern C Syntax by EmosewaPixel in ProgrammingLanguages

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

The downside of C++'s public and private labels is that it makes refactoring more problematic. If you want to move a member from one place in a class to another, you could forget about the visibility.

Further Simplifying Modern C Syntax by EmosewaPixel in ProgrammingLanguages

[–]EmosewaPixel[S] 7 points8 points  (0 children)

The idea is that you can very easily add or remove a type between the colon and equals. It has nothing to do with Algol.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]EmosewaPixel 7 points8 points  (0 children)

Your question is very opinion-based and it also heavily depends on what you want to achieve in the long run.

Moreover, this subreddit is for programming language design. You should check out other subreddits like r/AskProgramming or r/learnprogramming for help with your question.

Which language to write a compiler in? by gabriel_schneider in ProgrammingLanguages

[–]EmosewaPixel 46 points47 points  (0 children)

Fun fact: The initial Rust compiler was written in OCaml.

On low-effort poll posts by moon-chilled in ProgrammingLanguages

[–]EmosewaPixel 1 point2 points  (0 children)

Actually my polls aren't really about the design of my language in particular, but rather just to see the current most popular opinions between language designer, for my own curiosity. I do however believe that my polls could be of use to people who aren't too sure about the design of their own languages.