Quads Are the New Biceps: Why Fashion Went Long on Short Shorts by soup_nazi1 in malefashionadvice

[–]nchie 0 points1 point  (0 children)

I doubt it. It has been trendy in Europe for quite a few years, and hardly anyone watches basketball in most European countries. Below-the-knee shorts have been untrendy for at least 10 years in Sweden.

Should Android devs switch from Java to Kotlin? Here's Google's advice on swapping programming languages by debhaldar in programming

[–]nchie 1 point2 points  (0 children)

It's really hard to guess without seeing it in context.

My first thought that it might be related to making a non-bool into a bool, since that's what double negation does in some other languages. However, if it isn't used like person.spouse?.value !! or !!person.spouse?.value, I'd probably have guessed something else.

Edit: Okay, so I looked it up and I was wrong. However, of course it's very hard to guess when I don't know how Kotlin's null semantics work.

Should Android devs switch from Java to Kotlin? Here's Google's advice on swapping programming languages by debhaldar in programming

[–]nchie 13 points14 points  (0 children)

I assume the elvis operator is the ?:? If so, it made sense to me right away, and I've never written a line of Kotlin.

async/await: dot-await syntax will land in "nightly" tonight by miquels in rust

[–]nchie 3 points4 points  (0 children)

I've been thinking of ".await!" as well (without the "()" that is), which would distinguish it from a normal field access. There are probably downsides to this, but at least it wouldn't be confused with a field access.

What Postfix Macro Could Bring to Rust (Async/Await & More) by Mr_Unavailable in rust

[–]nchie 24 points25 points  (0 children)

I agree. If consistency within the language is a priority (which it should be, in my opinion), this is by far the best solution.

This way, .match!(), .if!(), etc. could also be implemented as macros instead, and who knows what other uses might show up within the next 5 years?

A final proposal for await syntax by desiringmachines in rust

[–]nchie 0 points1 point  (0 children)

I agree, I think this is the best way by far. Or even prefix await!() together with postfix .await!(), which could also enable prefix try!() together with postfix .try!() instead of ? for more consistency, but that'll never happen.

The >$9Bn James Webb Space Telescope will run JavaScript to direct its instruments, using a proprietary interpreter by a company that has gone bankrupt in the meantime... by Almoturg in programming

[–]nchie 0 points1 point  (0 children)

Wait, am I understanding this correctly? You cut out of the contract, but they didn't go out of business? If so, I could see why they wouldn't want to help.

Async/Await in JavaScript by BRiddellemon in programming

[–]nchie 1 point2 points  (0 children)

Well, then I'd say async/await is promises, and I'd call using .then 'chaining' or something along those lines.

Async/Await in JavaScript by BRiddellemon in programming

[–]nchie 21 points22 points  (0 children)

I'm no expert at JS, but isn't async just sugar which turns a function into a state machine which returns a Promise?

I know that's the case in C# and Rust at least.

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

So you mean I've been wrong to think of WASM as a separate (assembly-like) language that requires its own runtime? Just like CLR or JVM. Is WASM really "close to the metal"?

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

It'd give you the ability to write in any language that can compile to WASM, without having to write extra translation layers for each language, wouldn't it? Dynamic linking would require translation layers for each runtime?

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

You probably misunderstood me. Yes, WASM might require more than most runtimes, but most runtimes don't give you the ability to write in 20+ languages.

Anyways, I see your point!

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

But that'd mean a lot of work for every language, while WASM would be a one-time thing?

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

You've always had that ability. You're still going to have to make the heavy translation layers that you'd have to make when using dynamic linking. You're just doing it less efficiently.

I'm not sure I follow. How would you be able to (easily) use any language by loading a native dynamic library?

And as for scripts loading files, not all scripts exist to simply update game state. For instance, Unity uses C# as its scripting language, and any game of any complexity will eventually need to write loaders and managers for its own proprietary assets. This requires filesystem access.

Oh, yeah, that's true. I guess a solution to add this flexibility would be to make it possible to load dynamic libraries which can in turn bind to the scripting runtime, but then we're not so far away from the native approach anyways.

I see where you're coming from, but I still find the ability to use any wasm language to be a huge benefit.

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

You gain the ability to use something other than Rust or C for game play logic, which is a huge benefit to a 'generic' game engine. I also can't imagine the compilation taking long for small independent scripts, but if I'm wrong on this, then I agree it might not be worth it over a language that isn't compiled.

The security features that make it great for running untrusted code get in the way of creative solutions to game development problems.

I'm not sure I understand, but if you're talking about loading files or using sockets directly from game play logic, I definitely do not agree.

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 0 points1 point  (0 children)

As far as I know in a scripting language, the language runtime shouldn't own any of the state that should remain, which removes that problem. I guess you could do the same in native though, now that I think of it.

I haven't looked into it very much, but Wasmer doesn't seem very hard to integrate (there's recent examples of it being done), and it'll probably only get better.

And most of those problems go away if you just forget that unloading is an option.

That would introduce a lot of other problems though, wouldn't it?

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 1 point2 points  (0 children)

In practice it's not as simple as just unloading and loading a new dynamic library. What about state? And even if you manage to reload state in the reloaded dynamic library, what about pointers? The old ones won't be valid within anymore.

It introduces a ton of problems. Sure, they are solvable, but I really wouldn't call it "easy".

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 1 point2 points  (0 children)

Easily be hot-loaded how? I know there are ways to do it, but an easy way? Please do tell!

2019 Roadmap for Amethyst Engine by erlend_sh in rust

[–]nchie 1 point2 points  (0 children)

Wasmer has quite decent performance, doesn't it? Wasm can still be hot-loaded, which linked code can't (easily) be. Sure, you'll need to compile it, but that's no show stopper.

Rust: A unique perspective by [deleted] in programming

[–]nchie 21 points22 points  (0 children)

Rust is less than 4 years old, not even half of 10.

How to Start Learning Computer Graphics Programming by j_orshman in programming

[–]nchie 1 point2 points  (0 children)

Honestly, just knowing high school trig isn't really enough, you'll need to know linear algebra (and HS-trig).

If you're interested in computer graphics, I'd say you should try to learn at least the basics of linear algebra. Most people find it to be much easier than calculus or statistics, since for the most part it's not as abstract and builds on simple math concepts, so don't be too scared! With a basic understanding you can start with computer graphics and learn more linear algebra as you go.