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

Would be interesting to heard about similar attempts, in particular for other languages like C++.


I'm probably not gonna do it, but just out of interest: What is the syntax?


I'll start a brainstorming/drafting repo once I'm confident in deciding what I want.

Stating my sources of inspiration will win some people and turn off some people: In terms of syntax, Godot's GDScript comes closest to my ideal. In terms of features, Swift.

One thing I really want to try: instead of "functions" I want it to be "event handlers", so instead of

    func doSomething()
you'd say

    on doSomething()
A class instance could "contain" or "own" another class instance at runtime, similar to Godot's node-based hierarchy, and sending the `update()` event/signal to an instance could propagate it down the tree, making it easy to implement an entity+components architecture.

and you could overload handlers based on which type raised the event or emitted the signal:

    on doSomething() by PlayerClass
`caller` would be a keyword/object just like `self` is, in every handler scope so you could see `if caller is Player` or Monster for example.

Most relevant in terms of gameplay, I want `Stat` to be a core type: a number that has a maximum and minimum, and conditional buffs/debuffs affecting the final value, and so on.


Hmm, interesting! Sounds a bit like a DSL for ECS with tight integration of event handling.


There's other out-there ideas that I don't remember seeing elsewhere and I don't know what made me think of them, but I definitely want to try:

For example, let's call it "environments" or "event scopes": If a game entity (class) is in a certain environment/scope, that environment can trap/intercept all events/signals sent to/from that entity.

I'm not yet sure how exactly it would work/look, but I feel like it could be useful for easily implementing complex RPG-like conditions like: "Hitting {purple} {orcs} with this sword on a {Tuesday} night with a {full moon} deals +42 damage"

So none of the base objects need to know about that condition, but the "environment/scope" could impose or "overlay" extra conditions on every event passing through it..


Music being "good" is subjective. A programming language, however, can objectively be better if it allows a subset of programmers to better solve certain problems.

The reason for why OCaml is not more popular, thus, is that this subset is small. The reason for this may be either (a) habit or (b) it's not that much better than other languages. I'm gravitating to (b). OCaml guys seem to be quite dogmatic for the wrong reasons.


I posit (c) it’s from France and written mostly by French people and American naturally gravitates towards languages which generate hype in English and preferably from the USA.

Also it didn’t employ a marketing team to work on outreached and write fancy comments here and some people who have used it for 10 minutes are apparently offended by the Pascal-like syntax and can’t stop discussing it on every Ocaml discussion making every actual users tired.


The popularity of a language usually translates into better support, tooling and learning materials.


His name is Strangeway, he's sporting this preposterous mustache, and he looks after Big Ben. The guy is basically a living meme lol. He must be fun at parties; at least for like 2 minutes haha.


There‘s no way he is not a cartoon villain.


Why "Geometry"? Seems to just be a math 101.


It seems to be the naming pattern chosen for a whole series of such publications: https://geometryof.org/


  // You are responsible for releasing the structure in the end
  arrow_array.release(&arrow_array);
This doesn't look like RAII. How is this idiomatic for C++20? Why do you have to pass a pointer to "this" again as an explicit argument.


This is the extracted Arrow C data interfaces as documented in https://arrow.apache.org/docs/format/CDataInterface.html

It's not how you interact with the data in your own C++ code, it's for passing this data to other in-process consumers (libraries etc). While in the example it calls the release function, this is usually just passed to a downstream consumer and it's their responsibility to call it.

I agree that having such an example as the first one is confusing. Given that a large part of the point of Apache Arrow is passing data columnar data between libraries in different languages in memory, it makes some sense.


It's not how you interact with the data in your own C++ code, it's for passing this data to other in-process consumers (libraries etc). While in the example it calls the release function, this is usually just passed to a downstream consumer and it's their responsibility to call it.

This seems like a strange rationalizations when you don't need to have explicit release to be able to pass it to something else.


RAII predates C++98, I was already used to it in Turbo C++ for MS-DOS, and is pity we need to keep advocating for it as something extraordinary.


I think you're partly making the point for them, RAII has been idiomatic C++ since before c++ was standardized. It wasn't even idiomatic c++98 to be missing it, so to be missing it in c++20 library definitely still isn't.


Indeed, that is the point.


This doesn't have anything to do with what they said, they didn't say RAII was new.


Might be misunderstood by others not skilled in C++ when reading,

> This doesn't look like RAII. How is this idiomatic for C++20?


You can try to be insulting if you want but if you could explain the connection I think you would have already.


I wasn't.


You weren't what? Who are you saying "isn't skilled in C++" here and why would that matter?


Those that by reading that sentence think RAII is something new in C++20.


Why would someone who knows what RAII and C++20 are end up thinking that?


As a German, that's exactly what I was thinking lololol


These days, a lot of brainpower is spent on scamming people (case in point: Vivek Ramaswamy). One can really make quite a good living off of scamming people these days. If you could reduce the brainpower of that demographic, I think this would be good for everyone else.


If you primarily reduce the brainpower of scammers, like Vivek Ramaswamy, I think that would help, even if it reduces overall brainpower.


Basically https://www.shadertoy.com/ for dummies. Right up my alley haha ;)


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

Search: