cacheson

joined 2 years ago
[–] [email protected] 3 points 2 years ago (2 children)

I'm rather spoiled by python, so I feel like it could be more elegant. xD

But yeah, I do like how this one turned out, and nim runs a whole lot faster than python does. I really like nim's "method call syntax". Instead of having methods associated with an individual type, you can just call any procedure as x.f(remaining_args) to call f with x as its first argument. Makes it easy to chain procedures. Since nim is strongly typed, it'll know which procedure you mean to use by the signature.

[–] [email protected] 5 points 2 years ago (5 children)

Nim

This one was pretty simple, just parse the numbers into sets and check the size of the intersection. Part 2 just made the scoring mechanism a little more complicated.

[–] [email protected] 1 points 2 years ago

My solution for day 1 part 1 was simple and to the point. The other ones are getting increasingly less so. You're right that sometimes it's best not to get too fancy, but I think soon I may have to break out such advanced programming techniques as "functions" and maybe "objects", instead of writing increasingly convoluted piles of nested loops. xD

[–] [email protected] 2 points 2 years ago

I actually just learned about scanf while writing this. Only ended up using it in the one spot, since split worked well enough for the other bits. I really wanted to be able to use python-style unpacking, but in nim it only works for tuples. At least without writing macros, which I still haven't been able to wrap my head around.

[–] [email protected] 2 points 2 years ago (1 children)

I'm not doing anything too fancy here, just the first stuff that comes to mind and gets the job done. The filterIt template was pretty handy for part 1, though. I assume at some point in these puzzles I'll have to actually write some types and procedures instead of just using nested loops for everything.

I think it's a pretty cool language overall. I've only used it for one project so far, so there's a bunch that I still don't know. Haven't been able to wrap my head around how macros work, for example, though I've sort of figured out how to write really basic templates.

[–] [email protected] 8 points 2 years ago (4 children)

Nim

I hope y'all like nested loops:

[–] [email protected] 2 points 2 years ago (3 children)

Another nim person! Have you joined the community? There are dozens of us!

Here's mine (no code blocks because kbin):

[–] [email protected] 2 points 2 years ago (4 children)

Oh hey, a fellow nim person. Have you joined the community?

Here's mine. Kbin doesn't even support code blocks, so using topaz:

[–] [email protected] 1 points 2 years ago

Oh wow, I guess it doesn't take too much. I copied your survey post over to r/nim with a "cross-posted from [email protected]" link, and also invited the author of Enu to post here. I'll keep at it.

[–] [email protected] 1 points 2 years ago

Alright, not a bad idea.

[–] [email protected] 3 points 2 years ago

I imagine they'd also want to have something you can click that shows how many votes were local, how many were from other instances, how many were blocked, etc.

Actually, that would be really cool and worth doing regardless. Have a voting statistics view for each post where upvotes and downvotes are broken down per instance, and maybe by other criteria too. @ernest

2
anime_irl (media.kbin.social)
 
 

Discussed in this thread

3
anime_irl (media.kbin.social)
 
2
anime_irl (media.kbin.social)
 
 

Found at this thread. It's run by the same team as r/futurology on reddit.

1
anime_irl (media.kbin.social)
 
1
anime_irl (media.kbin.social)
 
 

Found at this thread

1
anime_irl (media.kbin.social)
 
8
anime_irl (media.kbin.social)
 
0
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/[email protected]
 

TL;DR- Be optimistic, but not fatalistic. Success still requires action. The article is worth reading in full, though.

Even if we accept the argument that the success of bitcoin as an asset due to its fixed supply and network effect is of high certainty, that does not guarantee the success of Bitcoin as a platform for a “full stack,” peer-to-peer financial ecosystem.

...

Failing to correct for this will result in the wider Bitcoin ecosystem suffering from choke points and resilience shortcomings which can and will be easily leveraged by adversarial actors to attack the network and its participants.

...

However, some will argue that ossification sooner rather than later is actually desirable as a defense against malicious changes to the Bitcoin core protocol, a la SegWit2x. This attitude entirely ignores and greatly increases another exploitable attack vector: stalling and preventing beneficial changes to the protocol which can enable more robust peer-to-peer and self-custodial solutions on subsequent layers. Indeed, after the spectacular failure of SegWit2x, any adversary would likely conclude the stalling strategy to be far more viable.

EDIT: Didn't propagate because lemmy.world was down

view more: ‹ prev next ›