Live data from Hacker News

Jai Language Primer

github.com

81–90 of 102 posts

Re: Jai Language Primer

#81

One language to look at for reference that most people haven't heard of is Clay. It isn't kept up any more, but it's aim was to be a modern generic C. It made use of very clean generic programming with move semantics and no garbage collection. The person who wrote it was using it as a substitution for C at his work already.

I remember Clay, it was mentioned on Reddit for the first time around the same time I first heard about Rust (back when Rust was a very different beast). I though Clay was very interesting, it's a shame it is more or less abandoned.

Re: Jai Language Primer

#82

Earlier quoted context omitted.

> Traditional hash tables are imperative data structures, and Lisp code (or Scheme code, at least) typically does not use them because of this. I don't understand that. > Association lists, which can be represented as literals, are persistent and provider faster lookup, despite being {snip} Those look like like they could be useful, but I don't see how they can replace hashmaps --- for one thing, they allow duplicate…

>I don't understand that. Introducing state into programs makes them harder to reason about, thus Scheme programmers generally discourage the use of mutable data structures when a persistent data structure would have worked. >Those look like like they could be useful, but I don't see how they can replace hashmaps --- for one thing, they allow duplicate "keys" (the first element of each pair). The way alists are used,…

Clojure has syntax for sets. I really like Clojure's data literals. I even think there's a Common Lisp package (or two) out there implementing reader macros to allow Clojure's syntax, but I don't think it's popular among Lispers.

Re: Jai Language Primer

#83

One language to look at for reference that most people haven't heard of is Clay. It isn't kept up any more, but it's aim was to be a modern generic C. It made use of very clean generic programming with move semantics and no garbage collection. The person who wrote it was using it as a substitution for C at his work already.

I remember Clay, it was mentioned on Reddit for the first time around the same time I first heard about Rust (back when Rust was a very different beast). I though Clay was very interesting, it's a shame it is more or less abandoned.

Looks like that is the current maintainer. The original designer was someone name KS Sreeram http://kssreeram.org/

Re: Jai Language Primer

#84

Earlier quoted context omitted.

I'm not sure what a soft real time game is. Here's two lists of some games with garbage collection https://en.wikipedia.org/wiki/List_of_Unreal_Engine_games https://unity3d.com/showcase/gallery

Unreal and Unity were built using C++. They offer garbage collected languages on top of their C++ game engines for scripting game logic. Any significant modifications to the engine will need to be done in C++

https://wiki.unrealengine.com/Garbage_Collection_Overview

The link is for C++ garbage collection in UnrealEngine, not UnrealScript nor Blueprints

Re: Jai Language Primer

#85

I stopped caring at no garbage collection.

You've posted several such dismissive comments to HN. Please don't do that any more.

Substantive criticism is fine, but it should be thoughtful, not snarky and shallow.

Re: Jai Language Primer

#86

Earlier quoted context omitted.

> Traditional hash tables are imperative data structures, and Lisp code (or Scheme code, at least) typically does not use them because of this. I don't understand that. > Association lists, which can be represented as literals, are persistent and provider faster lookup, despite being {snip} Those look like like they could be useful, but I don't see how they can replace hashmaps --- for one thing, they allow duplicate…

>I don't understand that. Introducing state into programs makes them harder to reason about, thus Scheme programmers generally discourage the use of mutable data structures when a persistent data structure would have worked. >Those look like like they could be useful, but I don't see how they can replace hashmaps --- for one thing, they allow duplicate "keys" (the first element of each pair). The way alists are used,…

> > > Traditional hash tables are imperative data structures, and Lisp code (or Scheme code, at least) typically does not use them because of this. Association lists, which can be represented as literals, are persistent and {snip}

> > I don't understand that.

> Introducing state into programs makes them harder to reason about, thus Scheme programmers generally discourage the use of mutable data structures when a persistent data structure would have worked.

Oh, maybe you typoed and meant to say that traditional hashtables are mutable data structures? In that case, I see what you mean; in Clojure, hashmaps, vectors, sets, and lists are all immutable and persistent. In Scheme, which data structures are persistent, or mutable/immutable?

> The way alists are used, only the first pair to contain the desired key is considered.

Ok, I see now. The function creates a hashmap from an alist.

> I learned that people reach for mutable hash tables far too frequently when there are better options available.

{raises hand} They're very easy to work with. In Clojure, I found myself doing extra work to work around the immutability. I'm sure it's a benefit for larger and multithreaded programs, but mine were neither.

> What languages even have literal syntax for sets? I can't think of any, but I'd like to know.

Clojure and Python. I suppose I could live without literal set syntax, but hashmap/hashtable syntax is extremely handy.

Re: Jai Language Primer

#87

Earlier quoted context omitted.

Unreal and Unity were built using C++. They offer garbage collected languages on top of their C++ game engines for scripting game logic. Any significant modifications to the engine will need to be done in C++

https://wiki.unrealengine.com/Garbage_Collection_Overview The link is for C++ garbage collection in UnrealEngine, not UnrealScript nor Blueprints

> Unreal's game-level memory management system uses reflection to implement garbage collection.

Yep. Game-level garbage collected C++. Which is exactly what I said, I just a didn't mention GC on C++ to avoid obscuring my point. I promise you the code at the game-engine-level is manually memory managed C++

Re: Jai Language Primer

#88

Earlier quoted context omitted.

I'm with you on this. I'm an old school gamedev. Shipped games on Atari 800, C64, NES, and most system since then. I hated garbage collection for the longest time. But, I have to acknowledge plenty of games are shipping with garbage collection. Unreal has garbage collection. Unity games have garbage collection. They seem to all be running just fine and there's plenty of large AAA games or close to AAA games made with…

They do not have garbage collection. You're conflating game development with game engine development. When a big powerful, flexible, C++ engine has been written for you, you can use C# or JavaScript or BluePrints to use the engine to make a game.

[deleted]

Re: Jai Language Primer

#89

Earlier quoted context omitted.

https://wiki.unrealengine.com/Garbage_Collection_Overview The link is for C++ garbage collection in UnrealEngine, not UnrealScript nor Blueprints

> Unreal's game-level memory management system uses reflection to implement garbage collection. Yep. Game-level garbage collected C++. Which is exactly what I said, I just a didn't mention GC on C++ to avoid obscuring my point. I promise you the code at the game-engine-level is manually memory managed C++

You do realize that reference counting is considered a form of garbage collection right? https://en.wikipedia.org/wiki/Garbage_collection_(computer_s...

BTW: I've written 6 engines for AAA games. 3 of them used reference counting. AAA C++ games use garbage collection all the time. Maybe yours didn't. Mine did. Unreal does. So does Unity

Re: Jai Language Primer

#90
post #2

I like the idea of a language syntax that allows easier refactoring. I think Rust is especially good at this as well, and I'm happy to see that Jai borrows from that.

I liked some things I saw which I've only seen in Pascal / Ada. Edit: Specifically I thought it was the same as what I've seen in Pascal for arrays[0] where you specify the range (in the case of characters) between x and y. I always thought that was kind of interesting, have yet to really see it implemented in another language afaik. [0] https://en.wikibooks.org/wiki/Ada_Programming/Types/array

Nim is a modern Pascal/Delphi with a Pythonic syntax. You'll probably like it.
Post reply on HN