Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 20 21:27
    straight-shoota synchronize #11758
  • Jan 20 21:22
    straight-shoota labeled #11758
  • Jan 20 21:22
    straight-shoota opened #11758
  • Jan 20 21:22
    straight-shoota labeled #11758
  • Jan 20 20:32
    Blacksmoke16 labeled #11757
  • Jan 20 20:32
    Blacksmoke16 labeled #11757
  • Jan 20 20:28
    mohd-akram labeled #11757
  • Jan 20 20:28
    mohd-akram opened #11757
  • Jan 20 19:26
    straight-shoota labeled #11670
  • Jan 20 19:26
    straight-shoota unlabeled #11670
  • Jan 20 19:20
    straight-shoota synchronize #11714
  • Jan 20 19:17
    straight-shoota closed #11716
  • Jan 20 19:15
    straight-shoota synchronize #11741
  • Jan 20 19:15
    straight-shoota edited #11741
  • Jan 20 19:15
    straight-shoota synchronize #11579
  • Jan 20 19:15
    straight-shoota synchronize #11707
  • Jan 20 19:14
    straight-shoota synchronize #11343
  • Jan 20 19:08
    straight-shoota closed #11617
  • Jan 20 19:07
    straight-shoota closed #11675
  • Jan 20 19:07
    straight-shoota edited #11675
mfiano
@mjfiano:matrix.org
[m]
However, despite being a huge Lisp fan, I stay away from macros unless I have to, unlike a lot of people that grow old trying to bend the language to do cool new things. However, when I actually do need to write a macro for some syntactic abstraction or boilerplate reduction, I need access to the language at compile time, not some tiny subset of it.
George Dietrich
@Blacksmoke16
fwiw you could do like {% for i in 0..4 %}
mfiano
@mjfiano:matrix.org
[m]
I am by no means trying to bash Crystal though. Its balance of simplicity and power is what drove me to try it, and I am very pleased with that. Lisp is pretty much 1000% power.
Yes, the "loop n times" instead of "loop over some collection/range" can be simulated like that, though I would have liked to use _ in place of i to convey meaning to the reader.
George Dietrich
@Blacksmoke16
_idx :shrug:
mfiano
@mjfiano:matrix.org
[m]
Bringing over the times method would almost be enough, except need some concise DSL to account for when the count is the length of a sequence, but still don't want to bind any e or i vars
</nitpick> The real issue is DRY violation as that issue discusses. I think a lot of people would be happy with work done in that area
George Dietrich
@Blacksmoke16
hm 0..collection.size
you also have .each and .map available
kinda
mfiano
@mjfiano:matrix.org
[m]
How would you use them in macroland?
George Dietrich
@Blacksmoke16
you have macro level variables that you could use it to set, but you'd have to use for in if you wanted to iterate over them and generate code
mfiano
@mjfiano:matrix.org
[m]
Oh sure, that'll just return a sequence for you to do whatever with, like {% for ... %} :)
George Dietrich
@Blacksmoke16
mjfiano
@mjfiano:matrix.org
[m]
That latest snippet answered an unrelated question I was going to ask.
I assumed right, that you can bind compile-time variables like that
George Dietrich
@Blacksmoke16
https://github.com/athena-framework/dependency-injection/blob/master/src/service_container.cr#L135 also quite a bit of complex logic using this feature if you wanted to poke around
mfiano
@mjfiano:matrix.org
[m]
Oh athena suite is your pet? I see that all over 😆
Never made the connection
George Dietrich
@Blacksmoke16
code is super gross because you cant reuse anything, but it would look much better with crystal-lang/crystal#8835
haha yea it is
mfiano
@mjfiano:matrix.org
[m]
It seems to be one of the most solid projects for sure
Sadly, I don't do any webdev these days anymore, so might use the logger or one of the decoupled things if anything.
George Dietrich
@Blacksmoke16
logger is built into the stdlib
mfiano
@mjfiano:matrix.org
[m]
Fair enough. Well there was one athena project i was thinking of using, but I forget what it was
George Dietrich
@Blacksmoke16
there is a CLI/console framework component that is currently in a working state, I just need to finish the docs on it tho
other than that, can deff use them independently. E.g. like the validator or serializer etc
mfiano
@mjfiano:matrix.org
[m]
Which project of yours (or other) would you say has the best docs? I would like to take a look at the tricks from the masters :)
George Dietrich
@Blacksmoke16
https://athenaframework.org they're all pretty well documented
mfiano
@mjfiano:matrix.org
[m]
(I am not very great at writing docs, probably because I have too many forever projects to get to that point)
George Dietrich
@Blacksmoke16
is fairly easy with crystal since it handles the bulk of the work if you give argument/return type restrictions
then you just need to fill in contextual information and examples
to tie everything together
mfiano
@mjfiano:matrix.org
[m]
Did you have to jump through a lot of hoops to get the style of the generated API docs to be like the Crystal website instead of that plain purple theme that is the default? I would prefer doing as minimal webdev as possible :)
mfiano
@mjfiano:matrix.org
[m]
hmm
George Dietrich
@Blacksmoke16
isnt too bad, mostly just config but the default purple one would deff be easier as you have to do pretty much nothing
and just setup CI to deploy it to GH pages
mfiano
@mjfiano:matrix.org
[m]
I'm actually surprised Crystal isn't used much for gamedev after looking at the library space. Seems like it'd be a great language for that.
Probably moreso to do with the user count
Ary Borenszweig
@asterite
Depending on how many lines of code a game usually has, I think having to compile the app in release mode all the time to get something fast (good FPS) and waiting 5+ minutes for that is probably not good. So I'm not sure Crystal is good for real world game development
From IRC (bridge bot)
@FromIRC
<straight-> Game dev is not just about FPS though
Ary Borenszweig
@asterite
What do you mean?
mfiano
@mjfiano:matrix.org
[m]
I hear that, though often times you shouldn't need very fast performance when testing, unless you have a complex physics system or something.
So debug builds should be acceptable
Gamedev is about trying to compute as much as you can on the GPU, getting it there in time if not all up front, and then moving it back to the CPU when you need prettier graphics :P
Ary Borenszweig
@asterite
Makes sense. Yeah, maybe you get decent fps in debug builds
mfiano
@mjfiano:matrix.org
[m]
Rust's compiler is pretty slow and their gamedev community seems to be really ramping up since the last couple years, and the compiler was about 3x slower a few years ago when it first started picking up.
Though I hear they are trying to leverage dynamic runtime dispatch more to account for all the monomorphism eating compile times.