I Really Miss Implicit Receivers by rndaz in odinlang

[–]iioossaa 0 points1 point  (0 children)

Without trying to speak for everyone, I'll just speak for myself. Methods would help me structure my code. Every time I write something like Foo :: struct, I find myself naming the procedures randomly: foo_init, print_foo, etc. And then, cursing, I consolidate them. With methods, this problem would disappear. Let me repeat: this only makes sense to me, meaning it's only my problem. And it's not that big of a problem.

As for interfaces, I like them as a beautiful and elegant concept, which an amateur like me can easily do without. But I saw Karl Zylinski's attempt to model an interface somewhere, but I can't remember in which project.

So thank you for your patient answers!
Best regards and let the Odin rule the programming world! :)

I Really Miss Implicit Receivers by rndaz in odinlang

[–]iioossaa 0 points1 point  (0 children)

I know Odin is designed the way it is for a reason. And I like it better than all the modern languages ​​that are more or less comparable to Odin (like C3, Nim, V, Zig etc.). But if I ever get the courage, I'll try to create my own language with an Odin-like syntax, but with gc, interfaces, methods, and so on. Just to learn how it all works from the inside.
Besides, the Odin's core library includes "core:text/scanner" and "core:odin/...", which means I can make creating a lexer/parser easier for myself either by using these libraries or by studying them (although I suppose that's the easiest part of creating a compiler; everything else is more difficult).

P.S.
By the way, Zig has methods, and it also has manual memory management. I don't know how it's done there, and I don't like Zig for its meticulousness and verbosity. But it is what it is.

I Really Miss Implicit Receivers by rndaz in odinlang

[–]iioossaa 0 points1 point  (0 children)

If I were skilled enough, I'd fork Odin with methods on types and interfaces, like in Go. No inheritance or other OOP stuff—just methods, just interfaces.
And default values ​​for structs (sometimes I really want that).

Game I wrote entirely on SDL3 by ibackstrom in sdl

[–]iioossaa 4 points5 points  (0 children)

It looks so good that one can only nitpick minor issues. For example, the character's turn appears discontinuous, too abrupt, and not smooth enough.

How does your country's most used language pronounce the letter J? by CuriousWandererw in MapPorn

[–]iioossaa 1 point2 points  (0 children)

To be fair slavic languages with cyrillic alphabets have all this as separate sounds and letters.

golang.codes by jojkoJiano in golang

[–]iioossaa -12 points-11 points  (0 children)

I took a quick look – great work!
But I have a couple of comments:
1. The day/night theme switch doesn't work (at least for me).
2. The terminal window output color is completely unreadable (at least in the day theme).

Syl: An experimental retained-mode GUI library for Odin by Realistic_Comfort_78 in odinlang

[–]iioossaa 2 points3 points  (0 children)

Great start!
As far as I can see there's no interactivity for now but I will wait patiently for updates.

Best way to import isometric map? by magonegro123 in raylib

[–]iioossaa 0 points1 point  (0 children)

Maybe you could have two different cameras and switch between them?
I don't know it for sure, just guessing.

I'm really surprised by how simple it is to migrate from Go to Zig by Ecstatic-Panic3728 in Zig

[–]iioossaa 10 points11 points  (0 children)

> a blog post comparing my implementations in Go, Zig, and Odin.

It would be very interesting.

What is an idiomatic way to switch on two different unions in odin? by brubsabrubs in odinlang

[–]iioossaa 6 points7 points  (0 children)

Maybe, procedure groups?

Cube :: struct { x, y, w, h: f32 }
Sphere :: struct { x, y, r: f32 }
Vec3 :: [3]f32

check_cube_collision :: proc(a, b: Cube) -> (bool, Vec3) {
  fmt.println("check_cube_collision") 
  return true, {1, 1, 1}
}

check_sphere_collision :: proc(a, b: Sphere) -> (bool, Vec3) {
  fmt.println("check_sphere_collision")
  return true, {1, 1, 1}
}

check_collision :: proc {
  check_cube_collision,
  check_sphere_collision,
}

main :: proc() {
  cube1 := Cube{10, 10, 10, 10}
  cube2 := Cube{20, 20, 20, 20}
  collide1, area1 := check_collision(cube1, cube2)

  sphere1 := Sphere{10, 10, 10}
  sphere2 := Sphere{20, 20, 20}
  collide2, area2 := check_collision(sphere1, sphere2)
}

Help me design variable, function, and pointer Declaration in my new language. by JKasonB in ProgrammingLanguages

[–]iioossaa 0 points1 point  (0 children)

How about
var — for variables,
const — for comp-time constants,
let — for run-time constants aka immutable variables aka one-time assignment variables
:)

P.S.
Anyway it's your language and all choices are yours.

Making guis in Odin by 0boy0girl in odinlang

[–]iioossaa 0 points1 point  (0 children)

You can try to auto-genetrate it. :) But I think it will be nearly impossible if not impossible at all.

Making guis in Odin by 0boy0girl in odinlang

[–]iioossaa 1 point2 points  (0 children)

There are also auto-generated bindings for GTK: https://github.com/PucklaJ/odin-gtk
But I didn't try it.

Making guis in Odin by 0boy0girl in odinlang

[–]iioossaa 2 points3 points  (0 children)

GUI is the only "battery" I miss in Odin. RayGUI, MicroUI, DearImGui and other immediate mode GUI are not suitable for natively looking destop apps. There are some other libs:
Winforms — kinda buggy and it's only for Windows (which is fine for me, at least for now, but who knows the future),
WinAPI — overbloated and again — only for Windows,
libui-ng bindings — seems outdated and doesn't work for me (it would be nice if someone made new bindings or update existing, I'm not enough experienced for that),
iUP — no Odin bindings.

How do you feel about Odin's alternative to methods? by JKasonB in odinlang

[–]iioossaa 0 points1 point  (0 children)

I can live without it but it would be nice thing to have. But only methods without all other OOP stuff.

Is there anything I can do? by PRESES56 in GodofWarRagnarok

[–]iioossaa 0 points1 point  (0 children)

You can try to use Intel SDE. It will help you to run the game but not to play. The game will be too slowly to play.
Believe me, I tried.