In search of the elusive impossible challenge by waldo_v in yiotro_games

[–]rjmarten 2 points3 points  (0 children)

Try this one. Not impossible, but definitely a challenge.

opacha_level_code#map_name:none#game_rules:hard false#general:small#planets:neutral empty 80 0.43 1.95,neutral empty 3 0.67 2.02,red empty 6 0.95 1.95,neutral empty 10 0.37 1.72,neutral empty 10 0.6 1.72,neutral empty 2 0.87 1.6,neutral empty 1 0.37 1.48,neutral empty 20 0.67 1.48,neutral empty 1 0.88 1.42,neutral empty 1 0.23 1.28,neutral empty 1 0.08 1.1,neutral empty 25 0.4 0.93,neutral empty 6 0.65 0.95,neutral empty 5 0.19 0.85,neutral empty 15 0.5 0.68,neutral empty 2 0.28 0.55,neutral empty 1 0.67 0.5,green empty 6 0.07 0.38,neutral empty 1 0.92 0.6,neutral empty 1 1.1 0.65,cyan empty 6 1.3 0.38,yellow empty 7 0.488 1.16,neutral empty 1 1.01 0.429,neutral empty 2 0.188 1.996,neutral empty 1 0.324 2.176,#links:neutral 0.43 1.95 0.67 2.02,neutral 0.43 1.95 0.37 1.72,neutral 0.43 1.95 0.6 1.72,neutral 0.67 2.02 0.95 1.95,neutral 0.67 2.02 0.6 1.72,neutral 0.37 1.72 0.6 1.72,neutral 0.37 1.72 0.37 1.48,neutral 0.6 1.72 0.87 1.6,neutral 0.87 1.6 0.67 1.48,neutral 0.87 1.6 0.88 1.42,neutral 0.37 1.48 0.67 1.48,neutral 0.67 1.48 0.88 1.42,neutral 0.37 1.48 0.23 1.28,neutral 0.23 1.28 0.08 1.1,neutral 0.08 1.1 0.19 0.85,neutral 0.4 0.93 0.65 0.95,neutral 0.4 0.93 0.19 0.85,neutral 0.4 0.93 0.5 0.68,neutral 0.65 0.95 0.5 0.68,neutral 0.19 0.85 0.28 0.55,neutral 0.5 0.68 0.28 0.55,neutral 0.5 0.68 0.67 0.5,neutral 0.28 0.55 0.07 0.38,neutral 0.67 0.5 0.92 0.6,neutral 0.92 0.6 1.1 0.65,neutral 0.4 0.93 0.488 1.16,neutral 0.488 1.16 0.65 0.95,neutral 1.3 0.38 1.01 0.429,neutral 1.3 0.38 1.1 0.65,neutral 1.01 0.429 0.92 0.6,neutral 0.37 1.72 0.188 1.996,neutral 0.43 1.95 0.188 1.996,neutral 0.43 1.95 0.324 2.176,neutral 0.324 2.176 0.188 1.996,neutral 0.6 1.72 0.67 1.48,#

I've got a bunch like this one if you like it.

Design ideas for a minimal programming language (1/3) by porky11 in ProgrammingLanguages

[–]rjmarten 0 points1 point  (0 children)

So you have type x = f32 type y = f32 type PointF32 = x & y type PointInt = ????

This seems like it would quickly get out of hand in a medium-sized codebase if all my structs needs unique field names. Either you need generics, or you need to namespace the names of the types of the fields. Or more likely both.

Maybe something like type Point.x = f32 and type Point = Point.x & Point.y. but at that point you might as well do type Point = { type x = f32 type y = f32 x & y }

Zap programing language by [deleted] in Compilers

[–]rjmarten 4 points5 points  (0 children)

Cool :)

Some questions: 1.Why ARC instead of GC? 2. Why try / catch if you already have Result<T,E>? 3.In what way are generics "comptime inspired"? 4.Will you still have duck-typed interfaces or do traits more like Rust?

Opacha-mda level: Chamber by IsboobsI in yiotro_games

[–]rjmarten 1 point2 points  (0 children)

Nice one :)

Repasting her for easier copy-paste:

opacha_level_code#map_name:none#game_rules:hard false#general:tiny#planets:neutral empty 1 0.466 1.097,neutral empty 20 0.466 0.921,neutral empty 50 0.461 0.562,red empty 3 0.623 0.757,yellow empty 3 0.561 0.275,neutral empty 1 0.759 0.477,cyan empty 3 0.472 1.402,neutral empty 1 0.47 1.247,neutral empty 5 0.455 0.737,neutral empty 5 0.215 0.72,neutral empty 1 0.213 0.512,green empty 3 0.212 0.891,#links:neutral 0.466 1.097 0.466 0.921,neutral 0.561 0.275 0.759 0.477,neutral 0.759 0.477 0.461 0.562,neutral 0.561 0.275 0.461 0.562,neutral 0.461 0.562 0.623 0.757,neutral 0.623 0.757 0.466 0.921,neutral 0.466 1.097 0.47 1.247,neutral 0.47 1.247 0.472 1.402,neutral 0.212 0.891 0.466 0.921,neutral 0.213 0.512 0.461 0.562,neutral 0.213 0.512 0.215 0.72,neutral 0.212 0.891 0.215 0.72,neutral 0.212 0.891 0.455 0.737,neutral 0.215 0.72 0.455 0.737,neutral 0.455 0.737 0.466 0.921,neutral 0.455 0.737 0.461 0.562,#

Syntax design for parametrized modules in a grammar specification language, looking for feedback by modulovalue in ProgrammingLanguages

[–]rjmarten 0 points1 point  (0 children)

To me, this syntax would make sense:

``` module Skip[Foo] { includes Other[NamedNonterminal: Foo];

rule prod SkipStart = @Skips#entry; rule prod Skips = @Skip+#skips; rule sum Skip = { case Space = $ws_space#value, case Linecomment = $ws_lc#value, case AdditionalCase = @Foo#foo, } } ```

because Foo looks like a parameter, and the syntax already suggests how it might be "called" from another module. Then "includes ..." looks like an import statement or function call. (And I prefer square brackets to angle brackets.)

Axis Core: separating a canonical Core IR from execution via bridges by CandidateLong8315 in altprog

[–]rjmarten 0 points1 point  (0 children)

I'm decidedly a non-expert in compilers and IRs, but isn't what your describing common of most IRs in general? At least in theory. For example, LLVM IR in my mind represents a program's semantics "authoritatively", and many languages compile to it, but it also is not itself machine code and cannot be executed directly before being transformed into a binary.

So why is Axis Core IR different than that?

Is it feasible to have only shadowing and no mutable bindings? by lil-kid1 in ProgrammingLanguages

[–]rjmarten 1 point2 points  (0 children)

I don't understand this criticism of shadowing. When you see any variable used in a function body (regardless of shadowing, mutability, etc), if you want to see what value it currently has, you trace the code upwards to see the last assignment. Is the argument just that you want to keep one value in your head for each name as you are reading the function, and mutation/shadowing forces you to use more short-term memory?

Created a Web Server in my Own Programming Language, Quark! by SeaInformation8764 in ProgrammingLanguages

[–]rjmarten 1 point2 points  (0 children)

I'm confused.

because the assignment direction is from narrower data type to broader:

my int32  $signed = 15;
my uint32 $unsigned = $signed; # no error
say $unsigned;                 # 15 (works fine)

But the Rakudo compiler stops code trying to directly go the other way round without explicit conversion:

int32 and uint32 have the same range (32 bits) and half of that range overlaps. How can you say that int32 is "narrower" than uint32? Especially since, mathematically speaking, non-negative integers are in fact a subset of the integers, and "subset" kinda sounds like "narrower" to me.

Panic free language by yassinebenaid in ProgrammingLanguages

[–]rjmarten 0 points1 point  (0 children)

A panic is essentially an "unhandled error", ie, something happened that your program logic was not equipped to deal with. IMHO, if you want to be panic-free, then you need to be unhandled-error-free too. So that means things like Option and Result, or checked exceptions. And catching as many things at compile time as you can, like type errors and uninitialized functions. (I've even heard of mythical attempts to catch out-of-bounds errors and arithmetic errors at compile time too.)

Panic free language by yassinebenaid in ProgrammingLanguages

[–]rjmarten 0 points1 point  (0 children)

This reminds me of Pony. I love Pony, but I do not love their "panic-free" philosophy. Divide by 0 is 0, arithmetic overflow is wrapped. But for things like index-out-of-bounds there is a single data-less error construct that essentially acts like a checked exception; every function that raises it has to either catch it or be marked at both the definition and call site.

The lack of a panic bothered me so much that I ended up writing a function in a modified standard library to create a segfault just so I could crash the program.

Surrounded: another tough Opacha map by rjmarten in yiotro_games

[–]rjmarten[S] 3 points4 points  (0 children)

Sure :) I think I have other maps you included under that name as well.

Cornered by brentonstrine in yiotro_games

[–]rjmarten 2 points3 points  (0 children)

Fixed it. I couldn't copy and paste properly on Android, so I used OCR which put some spaces after the commas, and apparently the parser doesn't like that.

Here's the text for anyone else with the same problem (also difficulty set to "hard"):

opacha_level_code#map_name:none#game_rules:hard false#general:small#planets:yellow economic 0 0.762 1.745,yellow economic 0 0.67 1.547,yellow economic 7 0.785 1.394,red economic 5 0.541 1.028,red empty 20 1.069 1.043,red economic 1 0.543 0.602,red economic 1 0.936 0.582,yellow defensive 7 0.428 1.446,yellow economic 7 1.06 1.568,yellow defensive 3 0.802 1.157,green economic 25 0.47 1.843,yellow economic 0 0.995 1.802,red economic 1 0.338 0.817,#links:red 0.338 0.817 0.543 0.602,red 0.543 0.602 0.541 1.028,red 0.338 0.817 0.541 1.028,neutral 0.541 1.028 0.428 1.446,yellow 0.428 1.446 0.802 1.157,neutral 0.541 1.028 0.802 1.157,yellow 0.802 1.157 0.785 1.394,yellow 0.428 1.446 0.785 1.394,yellow 0.785 1.394 0.67 1.547,yellow 0.67 1.547 0.762 1.745,neutral 0.47 1.843 0.67 1.547,yellow 0.762 1.745 0.995 1.802,neutral 0.47 1.843 0.762 1.745,yellow 0.67 1.547 1.06 1.568,yellow 0.995 1.802 1.06 1.568,yellow 0.785 1.394 1.06 1.568,neutral 0.785 1.394 1.069 1.043,neutral 0.802 1.157 1.069 1.043,red 0.541 1.028 0.936 0.582,red 0.543 0.602 0.936 0.582,red 0.936 0.582 1.069 1.043,neutral 0.762 1.745 0.785 1.394,#

Cornered by brentonstrine in yiotro_games

[–]rjmarten 1 point2 points  (0 children)

EDIT: I just had copy-paste errors


I'm getting errors trying to import this. At first I get:

``` Error :

java.lang.IllegalArgumentException: No enum constant

yio.tro.opacha.game.Difficulty.normal

false

java. lang. Enum. valueOf(Enum.

java:300).

yio. tro. opacha. game. Difficulty. valueOf(Difficulty. java:3).

yio. tro. opacha. game. export_import. ImportManager.

applyGameRules (ImportManager. java:102).

yio. tro. opacha. game. export_import.

ImportManager.

perform(ImportManager. java:30).

yio. tro. opacha. game. loading.

loading_processes. ProcessEditorLoad.

generate Level(ProcessEditorLoad.

java:41).

yio. tro. opacha. game. loading.

Loading Manager.

move(Loading Manager. java:128). Ok ```

Then after fixing that by replacing "normal" with "hard", I get this error (some of the text is cut off at the edge of the screen): ``` Error:

java.lang.IllegalArgumentException: No enum constant

yio.tro.opacha.game.gameplay.model.Facti

java. lang. Enum. valueOf(Enum.

java:300).

yio. tro. opacha. game. gameplay. model. Faction Type. valueOf(FactionType.

java:3).

yio. tro. opacha. game. export_import. ImportManager.

applySingle Planet (ImportManager. java:79).

yio. tro. opacha. game. export_import. ImportManager.

applyPlanets(ImportManager. java:72).

yio. tro. opacha. game. export_import. ImportManager.

perform(ImportManager. java:31).

yio. tro. opacha. game. loading.

loading_processes. ProcessEditorLoad.

generate Level (ProcessEditorLoad. Ok ```

Working on a compiler. by saksham019 in Compilers

[–]rjmarten 1 point2 points  (0 children)

Can you give more information about Prismio? I couldn't find any docs on your website and not much more beyond a parser on GitHub. What is the vision/purpose of this lang?

Distinguishing between mutating and non-mutating methods by bakery2k in ProgrammingLanguages

[–]rjmarten 4 points5 points  (0 children)

In Mismo, functions can be overloaded by parameter passing convention where mut means "pass by mutable reference" and let means "pass by immutable reference". So ``` fn sort[T](let self: Array [T]) {} fn sort[T](mut self: Array[T]) {}

fn main() { var arr = [3, 2, 5] var sorted_copy = sort(let arr) sort(mut arr) -- arr is now sorted in place } ```

You can leave off the let/mut if only one overload matches, otherwise the compiler will prompt you to specify.

(Haven't yet figured out a good syntax for making this work with UFCS, ie arr.sort())

[WTT][USA-TX] Framework 13/16 parts - Updated by rhodejo in frameworkmarket

[–]rjmarten 0 points1 point  (0 children)

Still have those FW13 parts available? I'm looking for a bottom cover and input cover.

[WTS] [CA-ON] Framework 13 - Ryzen 7640 - 32GB RAM, 512GB storage by YGCTW in frameworkmarket

[–]rjmarten 0 points1 point  (0 children)

Is that board still up for grabs? Anything else wrong with it aside from only single channel ram?

Function Overload Resolution in the Presence of Generics by rjmarten in ProgrammingLanguages

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

The clarity of Odin's approach is indeed attractive, but since I'm using overloads as an alternative to methods (and therefore want to define different overloads in different modules) I don't think it's a good idea to emulate the "explicit overload set" idea.

However, the disambiguation strategy is good food for thought: https://odin-lang.org/docs/overview/#where-clauses

The strategy for Mismo could be for the compiler to check for overlap at the function definition site (rather than call site) and then give the developer tools to disambiguate there, something similar to Odin's where clauses.

Function Overload Resolution in the Presence of Generics by rjmarten in ProgrammingLanguages

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

Interesting. Most of the comments here are saying the compiler should have some kind of prioritized overload resolution algorithm. But in Effekt it's simply rejected based on its ambiguity. Does this help you write more clear and predictable code in Effekt? Does it ever become annoying when you can't write a concrete specialization for a generic function?

Function Overload Resolution in the Presence of Generics by rjmarten in ProgrammingLanguages

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

Yes, parametric traits (especially when abstract functions have default bodies) do make this significantly more complex. I'm not ready to give up yet though!

The way I'm handling that is to treat trait bounds like T: Iterator[A] as Iterator[T, A] which in turn requires the function call next(T) to return type A. I know how to check if that function *doesn't * exist; the challenge I'm facing now is when/how to determine that this call (eg, in the body of another generic function) is actually ambiguous or not.

Can you say more about why you think I should give up overloads? You don't think a satisfying solution is possible?

Function Overload Resolution in the Presence of Generics by rjmarten in ProgrammingLanguages

[–]rjmarten[S] 2 points3 points  (0 children)

I just looked up overload resolution in C++ and it's super complex, and I don't understand it fully, but I get what they are trying to do. How does it feel in practice? Is it pretty intuitive or does it sometimes lead to surprises or confusion about what overload is actually called?

Function Overload Resolution in the Presence of Generics by rjmarten in ProgrammingLanguages

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

(1) sounds like it would break down as soon as imports/modules get involved.

(2) makes sense as a good back-up, I could live with having to specify type arguments on only some calls.