Live data from Hacker News

Show HN: I made a 2D game engine in Dart

bullseye2d.org

31–40 of 41 posts

Re: Show HN: I made a 2D game engine in Dart

#31

I hope this isn't off topic. What is the draw of Dart? In other words, what does it claim to do special or emphasize over other langauges? Like if you were going to try to convince someone they should give Dart a try, what reasons would you give?

Off the top of my head:

- Properly cross platform (including first-class JS/WASM interop)

- AOT & cross compilation

- Hot reload

- Static typing with many nice features (generics, extension types, enhanced enums, etc)

- Expressive without being overly verbose

- Well-supported by the language & SDK teams (i.e. it's not dead)

- Easy build/package system

The only things I really feel are missing are (1) union types and (2) access modifiers like protected/friend.

Re: Show HN: I made a 2D game engine in Dart

#32

Earlier quoted context omitted.

I ported this game from the Book "Code The Classics" which was written in Python/PyGame. It should be relativley easy to add mobile touch inputs to it, but I didn't have time for that yet.

Probably worth it as most people read HN on tablet or phone. What is potentially a problem is the lack of training material for AI agents to generate games on top of this platform.

Anecdotally, I never use HN on mobile devices. I don't have access to data for HN device usage. Do you?

"Training material for AI agents?" The lack of such is not a problem. AI agents are an adversary for many, not a target.

Re: Show HN: I made a 2D game engine in Dart

#33

I hope this isn't off topic. What is the draw of Dart? In other words, what does it claim to do special or emphasize over other langauges? Like if you were going to try to convince someone they should give Dart a try, what reasons would you give?

I would say that the best benefits are: - Cross Compilation (even wasm and js) out of the box - Simple concurrency model, similar to NodeJS - Ability to use it on a popular cross platform framework (flutter) - Hot reload capibilities (has JIT and AOT mode) - Strong developer tool chain All of these are built on top of a language that has a pretty syntax and supports many language paradigms. The biggest con is the (we…

When making bullet points, I think you have to add a empty line in-between each point so it gets rendered as a list

Re: Show HN: I made a 2D game engine in Dart

#34

I hope this isn't off topic. What is the draw of Dart? In other words, what does it claim to do special or emphasize over other langauges? Like if you were going to try to convince someone they should give Dart a try, what reasons would you give?

Dart/Flutter imo is basically a better React Native. It doesn't have 30 years of JavaScript legacy code. The problem is Google cut significant funding to Flutter, it's not clear if it'll be supported for much longer. I've built several toy apps in flutter for myself and friends. I like Flutter. But Google's lack of commitment is concerning. Dart itself feels like a safer Typescript. The tooling is just better.

> The problem is Google cut significant funding to Flutter

Just to be clear, Google slashed teams across their entire organization, not just the Flutter / Dart team. So it wasn't like Google targeted the Flutter / Dart project

> it's not clear if it'll be supported for much longer

> Google's lack of commitment is concerning

I had similar feelings. When looking this up, it showed that Google continues to actively develop and invest in Flutter, with regular updates, new features, and performance improvements being released for both Flutter and the Dart language.

The official Flutter roadmap has been updated through 2025

https://www.reddit.com/r/FlutterDev/comments/1jrz4cd/googles...

Re: Show HN: I made a 2D game engine in Dart

#35

I hope this isn't off topic. What is the draw of Dart? In other words, what does it claim to do special or emphasize over other langauges? Like if you were going to try to convince someone they should give Dart a try, what reasons would you give?

Off the top of my head: - Properly cross platform (including first-class JS/WASM interop) - AOT & cross compilation - Hot reload - Static typing with many nice features (generics, extension types, enhanced enums, etc) - Expressive without being overly verbose - Well-supported by the language & SDK teams (i.e. it's not dead) - Easy build/package system The only things I really feel are missing are (1) union types and…

When coming from TS to Dart, the lack of union types was a huge bummer. But I saw a discussion somewhere that you can achieve something close with sealed classes to model union types combined with exhaustive pattern matching, but Idk.

Another user hinted at this package https://pub.dev/packages/extension_type_unions, have you seen it before?

Also it's worth noting that sum types can be achieved with Dart 3!

Re: Show HN: I made a 2D game engine in Dart

#37

Earlier quoted context omitted.

Dart/Flutter imo is basically a better React Native. It doesn't have 30 years of JavaScript legacy code. The problem is Google cut significant funding to Flutter, it's not clear if it'll be supported for much longer. I've built several toy apps in flutter for myself and friends. I like Flutter. But Google's lack of commitment is concerning. Dart itself feels like a safer Typescript. The tooling is just better.

> The problem is Google cut significant funding to Flutter Just to be clear, Google slashed teams across their entire organization, not just the Flutter / Dart team. So it wasn't like Google targeted the Flutter / Dart project > it's not clear if it'll be supported for much longer > Google's lack of commitment is concerning I had similar feelings. When looking this up, it showed that Google continues to actively deve…

I understand that, I still don't know if I trust Google here.

To be fair, I can get things done much faster in flutter than in other frameworks.

I did build a small Kotlin project though, I might switch to Kotlin Multiplatform if something happens with Flutter.

Re: Show HN: I made a 2D game engine in Dart

#39

I hope this isn't off topic. What is the draw of Dart? In other words, what does it claim to do special or emphasize over other langauges? Like if you were going to try to convince someone they should give Dart a try, what reasons would you give?

Dart/Flutter imo is basically a better React Native. It doesn't have 30 years of JavaScript legacy code. The problem is Google cut significant funding to Flutter, it's not clear if it'll be supported for much longer. I've built several toy apps in flutter for myself and friends. I like Flutter. But Google's lack of commitment is concerning. Dart itself feels like a safer Typescript. The tooling is just better.

If Flutter didn't exist would Dart be worth looking into? ATM It sounds like Dart w/Flutter) is good for "making native apps" and that maybe doesn't excel outside that niche?

Re: Show HN: I made a 2D game engine in Dart

#40

Earlier quoted context omitted.

Off the top of my head: - Properly cross platform (including first-class JS/WASM interop) - AOT & cross compilation - Hot reload - Static typing with many nice features (generics, extension types, enhanced enums, etc) - Expressive without being overly verbose - Well-supported by the language & SDK teams (i.e. it's not dead) - Easy build/package system The only things I really feel are missing are (1) union types and…

When coming from TS to Dart, the lack of union types was a huge bummer. But I saw a discussion somewhere that you can achieve something close with sealed classes to model union types combined with exhaustive pattern matching, but Idk. Another user hinted at this package https://pub.dev/packages/extension_type_unions , have you seen it before? Also it's worth noting that sum types can be achieved with Dart 3!

I'm a heavy user of exhaustive pattern matching with sealed classes, definitely a great feature. You can achieve the same outcome as union types, but it's a lot more leg work, e.g.:

```

sealed class MyParam {}

class Bar extends MyParam { String val; }

class Baz extends MyParam { int val; }

void foo(MyParam param) {

  switch(myParam) { 

      case Baz(val: final val):

      case Bar(val: final val):

  }
} ```

compared to:

```

void foo(Bar | Baz myVar) {

    switch(myVar) { 

        case Bar:

        case Baz:

    }
} ```

I hadn't seen the extension_type_unions package, though, I'll check it out.

Post reply on HN