@ASCII-only Any idea why ≧⁻∕ΣθLθθI∕θX∕ΣEθXι²Lθ·⁵ is rounding its output? ≧⁻∕ΣθLθθ≧∕X∕ΣEθXι²Lθ·⁵θIθ works but is less golfy. If you need to fix something, please also consider vectorising Power, so I can write ≧⁻∕ΣθLθθI∕θX∕ΣXθ²Lθ·⁵
Specifically, you were supposed to write a program that would output 2016 (or whatever the year was); and where if you changed any single character, it would either be a build error, or still output 2016.
I didn't find the challenge when I searched for it.
My most common situation is to get mad that the existing interpreters are all unsuitable for some reason and be forced to implement my own for some challenge.
@feersum that's.. currently my case for java, C, JS, APL & pretty much every language I've used, but I certainly don't have the patience to make my own versions of literally all the languages :p
Canvas was made because SOGL didn't meet my requirements, and for a while i've been gathering ideas for a 3rd ascii-art language because it too is a bit bad
@ngn I personally though think that features being on the IDE not on the language is a good thing - sometimes the visual representation you want to see is just not the same as the stuff you write
auto-indenting code is one example - you want to be able to write code without worrying about it, but want to be able to visually tell the difference from different scopes.
longer/more logical variable names are (usually) easier for humans to remember, read & correlate, but having to write them out is very annoying, hence code completion.
by that logic, C's undefined behavior is completely horrible as the best way to avoid it is to have tools that tell you about it appearing (besides learning the language well)
@dzaima what i usually do is name my variables something very short with a comment on initialisation. long names distract me. i must be developing chronic dyslexia from too much golfing :)
@wizzwizz4 i use clang for the language i'm working on (ngn/k). would there be any advantages (performance in particular) in writing llvm ir directly instead of c?
i've just been bitten by clang's aggressive optimisation
#define _0W (~0UL>>1) //0x7f...f
void f(long long v){printf("%d\n",v+1<(long long)(2-_0W));} //falsey with -O1 or higher; truthy otherwise
int main(){f(_0W);}
@ngn what in your opinion would be better: 1) APL interpreter optimizing ¨es out if it can figure out how to; 2) ide telling you to; 3) you're on your own
@ngn that's why I gave the option of the IDE - doesn't bloat the interpreter, but helps the user. Both simple things like that, but (⍳100)+¨⊂⍳100 vs (⍳100)+⊂⍳100 is a speedup
got it. "-ftrapv Generate code to catch integer overflow errors. Signed integer overflow is undefined in C. With this flag, extra code is generated to detect this and abort when it happens."
Though I guess it also depends on how heavy each test is. My workplace has a test suite with something like ~200 tests that take about 10 minutes to run all the way through.
@El'endiaStarman Each test suite (~500) sets up and tears down a copy of the app. Network access is mocked, and it all runs on a few NVMe RAIDs. It's an expensive setup, but it made a huge difference in test times.
@mınxomaτ Sounds like our setup dialed up to 11. We setup/teardown nearly everything for each test and everything external, especially network access, is mocked. Setting up and tearing down definitely contributes a lot to the time it takes, but it does also mean each test can assume a clean slate, which is convenient for the devs.
@ngn If you avoid tricks and UB, it's never too smart. If you don't avoid UB, you're going to get demons leaking from your nose and a velociraptor attack from the side.
I have a list of numbers as shown below:
nums = [73, 59, 95, 27, 77, 57, 66, 24, 11, 36, 89, 57, 58, 19, 93]
My task is to reduce a number in any one position in above list to get the resulting XOR of all the numbers in the list as 0.
This is the Nim Game problem if you know about Game.
The ...