« first day (2181 days earlier)      last day (2663 days later) » 

3:00 PM
@quartata well, funny enough, that seems more syntatically correct than the blocking method other languages use
but I agree: it'd be better with a promise
 
The async keyword is a form of sanity checking. If a function calls an async funcrion, that function itself must be async or else await the function call
It's pretty clever IMO.
 
Anonymous
@quartata A better form of sanity checking would be to verify that you actually want to use Node
 
I mean, that doesn't seem necessary. Simply have the function return a promise.
 
@Mego This is ES7 not Node
 
we already know how to deal with promises in JS
I was reading an article on why C# used the async keyword, and it was to maintain backwards compatability
because "await" could be the name of the variable
which I can agree with
so, that's probably why JS did it too
 
3:05 PM
Alright guys I have a game idea thing
It's about a guy who's stranded on a toxic planet
And the only thing that he can work with is one single tree
And he has to "cleanse" the planet just through that tree
Thoughts?
 
so, Factorio 2: Recovery?
 
@NathanMerrill Kindabutnotreally
Is Factorio all about automation?
If so then yes kinda
 
Is he able to wait 30 years for new trees to grow?
 
Did I miss something?
 
3:07 PM
@BusinessCat You can harvest a tree and then replant and stuff
It's kinda like Minecraft speeds
 
Anonymous
@quartata Oh I thought we were still talking about Node
 
I just got here, and it seems like the conversation went from js to games
 
Sounds like Dota 2. Sometimes I have to wait for trees to grow before I can clenase the world of screaming Russian hard carries
 
@Qwerp-Derp I would be willing to make it with you, if you like :P
 
@TrojanByAccident I'm probs going to make it in Java
If you're willing to help than yey please do :)
 
3:09 PM
Alrighty
Now to learn java
lmao
 
lmao
Or I could just do it in JS but that's going to be a pain
I just finished learning Processing anyway
So I could just use that
 
Man now I really want to try Factorio...
 
I just got Factorio, don't have time to try it out
@TrojanByAccident I'll write game ideas on a hackmd or something
 
@Qwerp-Derp What about using a proper game engine? I wouldn't be able to do work on it for a bit if we do it that way, but it might be easier
 
Hmmm, like Unity?
But for Java?
 
3:11 PM
Does Factorio run on Linux?
 
Unity, GM, idk
 
also ew gross unity
 
Anonymous
@quartata Yeah, not well though from what I've heard
 
@quartata What about Unreal?
 
@quartata Unity can be decent
 
Anonymous
3:12 PM
But it should be good enough for regular, non-megabase play
 
@Qwerp-Derp Better
 
Anonymous
Factorio is an insanely fun, addictive game
 
@Qwerp-Derp Unreal engine could work
 
What's LWJGL (Light-weight Java Gaming Library)?
 
@TrojanByAccident Actually it can't be
 
3:13 PM
@TrojanByAccident But isn't that for making shooter stuff?
 
Unity is disguisting for a number of reasons too stupid to go into
 
@NathanMerrill Do you have any XP with making Java games?
 
not really
 
@quartata Please go into depth with one or two issues
 
I'd recommend libgdx
but when I make games, I make KoTHs
 
Anonymous
3:14 PM
Unity refused to develop a Linux port for years
 
@NathanMerrill Fair enough
 
@Qwerp-Derp "Unreal Engine 4 is a suite of integrated tools for game developers to design and build games, simulations, and visualizations." "Although primarily developed for first-person shooters, it has been successfully used in a variety of other genres, including stealth, MMORPGs, and other RPGs."
 
So nothing GUI basically right?
 
@Qwerp-Derp LWJGL is just a wrapper around OpenGL. It's a rendering pipeline
 
not besides a few brief stints with libgdx
 
3:15 PM
@TrojanByAccident Yeah no, I'm looking at LWJGL
 
Anonymous
UE4 was used to make Antichamber :P
 
@quartata What would you recommend for TLT?
TLT = The Lone Tree (the game)
I'm thinking like a 2d map design thing
Nothing too complex
 
@Mego @quartata the developers are always working on performance, so I wouldn't be surprised if any performance issues were solved with linux
 
@Mego *UE3
 
@Mego What Unreal?
@quartata So is LWJGL good?
 
Anonymous
3:17 PM
@quartata Whoops yeah numbers are hard
 
I kinda want an easy engine designed for 2D stuff
 
Anonymous
@NathanMerrill The performance issues on Linux were/are due to OpenGL instead of DX iirc, so there's not much the devs can do
 
Or should I just ditch them all and use Processing?
 
Anonymous
I know it's definitely playable on Linux, but as with all things Linux, it takes a bit more work
 
UE4 is fine for top down games.
 
3:18 PM
@Mego opengl is a graphics library, which means that it would have a constant performance, which wouldn't grow with bigger factories, right?
 
What language is Unreal written for?
Java right?
 
@NathanMerrill It's more because DirectX people don't know how to use OpenGL
 
oh, Factorio uses DX
I understand :)
 
Anonymous
Yep
 
@Qwerp-Derp C++ (you probably won't have to write any) and UnrealScript
 
Anonymous
3:20 PM
There's an OpenGL version for Linux, but it doesn't work as well, because it's not as heavily optimized as the DX version is
 
@quartata I need a Java library :(
 
Why?
 
@Qwerp-Derp are you thinking we should do it top-down?
 
@TrojanByAccident Ayy
@quartata I want to do Java stuff
or I can just do Unreal, but I kinda want to look into Java
 
lol
well while you all are arguing, I'm going to go learn java
@Qwerp-Derp ping me when you've made a decision
 
3:22 PM
Very strange to see this much Java appreciation in TNB
 
Well OK good luck. You'll have to do it by hand with LWJGL or JOGL then.
@Mego I'll never undersrand why people still use DirectX and refuse to learn OpenGL in 2017
DirectX is bereft of life at best
 
@quartata Is that a bad thing? I have a feeling it's going to be hard
@TrojanByAccident I think we should just write stuff down for the game first
Before we actually dive into making it
 
The only real reason it gained dominance IMO is because of the Xbox
 
Well GTG everyone, sleep
 
@Qwerp-Derp Alright
 
3:24 PM
@Qwerp-Derp It depends. Probably not that bad.
 
Last semester I had to use OGRE
It was so frustrating
 
OGRE is just a scene renderer.
 
Yeah
But he had us trying to make games in it
 
3:52 PM
@TrojanByAccident this room is good at changing topics
Apr 4 '16 at 5:38, by Downgoat
Only this room can go from the Electorate badge to recieving rep from a Nigerian prince's FBI fer tap secrit avocad juic fermula
 
The Nigerian Prince is a goat?
 
@Downgoat lol
We went from discussing something about code straight into writing a game
 
that's considerably more on-topic
 
For french, we had to conjugate some verbs to the "future proche" tense, and since they were all irregular, we had to search them on the internet. Instead of doing that, I tried to put my weak bash skills into creating a script that returns the stem of the verb when you call it. After 1.5 hours, I completed the script (which took most of my lunch time), while my friend just searched the verbs and finished the task in 10 minutes.
 
that's why you learn jelly
it's shorter therefore it takes less time to code
 
4:03 PM
@Fatalize I'm using Perl because I'm most familiar with it (I'm planning to write the interpreter in Perl too; more golflangs need interpreters of their own rather than being transpiled)
 
0
A: Sandbox for Proposed Challenges

GarethTotally Cubular This is similar to (but, I suspect, a bit harder than) my Flippin' Squares question. Create a program or function to unjumble a 9x9x9 cube of digits by rotating individual 3x3 cubes within it. Input Input will be a 9x9x9 cube. I'm not going to be as strict over the input as I ...

 
@KritixiLithos this is why you gotta learn Cheddar
 
@KritixiLithos I once generated a bunch of tables of conjugations of Portuguese verbs with Python code that generated LaTeX. I think that took me less time than just doing it would have...but it was certainly more fun that way.
 
@EᴀsᴛᴇʀʟʏIʀᴋ but it'll take me a lot of time before I learn Jelly
 
better in the end
 
4:07 PM
@El'endiaStarman I got the verb stems by fetching them from the internet (the same site my friend used). But I'll agree, it was really fun and I learnt some bash
@Downgoat s/gotta/goat to
 
Don't worry I'm disappointed in myself too
 
@ais523 I'd love to get a look at it! I've always wondered what a parser would look like, but I can't read most languages ;w;
though I suppose that it's "simpler" if it's just manipulating a stack rather than storing variable names and code...
 
idea: what if numbers were iterable, and iterated back towards 0
that way, you could do loop 3
and it would cause you to loop 3 times
 
@NathanMerrill did you mean: ruby
 
oh, does ruby do that?
 
4:12 PM
@El'endiaStarman discretizing the wave function: mtnmath.com/whatrh/node66.html
 
in ruby, everything is an object, and integers have a looping function
e.g. 5.times do |x| loops 5 times with x as the iterator
 
then times is your iterator
aka, 5.times returns an iterator
which, is probably better than 5 being an iterator itself
 
@GabrielBenamy well I haven't written it yet, so I can't exactly show it to you
currently working on an answer to a PPCG challenge
but maybe I'll have a go at it after that
however, it's a golflang parser so it'll be pretty weird
more normal parsers are normally written using parser generators
 
Are golflang parsers just a bunch of switch cases?
 
that's how lexers normally work
 
4:18 PM
depends on the lang. If your commands are executed one at a time and stack based, then iterative switching is easiest
 
lexers?
 
a lexer looks at a string of letters and works out which ones form tokens
 
aka, it turns text into commands
(doesn't actually run the commands)
 
I mean, from the standpoint of someone who has a math degree, not a comp sci degree... what else could I do?
 
e.g. if I lex int main(int c) { return c+=+4; }, I get int, main, (, int, c, ), {, return, c, +=, +, 4, ;, }
 
4:20 PM
@ais523 put commas?
are all of your commands 1 symbol?
 
@NathanMerrill was just doing that when I saw how the Markdown came out :-)
 
@NathanMerrill This is a interesting idea but I guess most languages don't do it since A) usually a number itself is t what you're iterating through, usually it's an array or something B) it's not really clear to someone who doesn't know the syntax since it's not like 0..3 where you can tell it's a range
 
in the language I'm working on, the lexing is nontrivial, mostly due to strings (which are multiple characters long but a single token long)
 
@Downgoat yeah, I like times better
however, ruby totally missed out on great english-reading
instead of doing 5.times do
 
although there are a few other special lexer cases
 
4:22 PM
they really should have done loop 5.times
 
Oh, I thought do...end returns a lambda which is passed to 5.times function
 
maybe? even if that is the case, it still doesn't read as well IMO :P
 
I guess do 5.times could of also worked
 
@PhiNotPi Oh, of course the work has already been done in order to simulate quantum mechanics.
 
4:24 PM
Isn't that for i in range(5):?
 
yep
but when was the last time you actually needed i?
I agree, there are use cases, but declare it when you need it :)
 
When do you need to loop something a constant amount of times without needing i? For me, almost never.
 
a constant number of times is rare
but passing in a variable is pretty common, IIRC
 
I've written an extensive analysis of the Windows client of TunnelBear v2: medium.com/@255/…
 
Idea: for range(5) and implicitly initialize a variable $. If nested, use $1, $2, etc.
 
4:29 PM
pytek does that, but I don't like it
because it feels like magic, and because it makes it harder to use nested loops
 
You could have both
 
Anonymous
Even looping a variable number of times, you often don't need the loop variable
 
so, in python, when I don't need the looping variable, I use _
 
You can just write for range(5) and don't worry about $, and do for i in range(5) when you do need the variable.
 
searching through my code, I've used "_ in range" 4 times
 
4:31 PM
Also makes it golf-friendly
 
Anonymous
Though if you're using a bunch of nested loops where you don't need the loop var, you should probably be using itertools stuff or something similar
 
very true :)
 
But options are nice
 
That's where El'endia and I disagree: I like languages with a single "best way" to do things
she prefers not to force design down people's throats
like, in Python, you could add "switch" to give the people the option over dictionaries
but dictionaries are much better :P
 
Anonymous
1) Elendia is male. 2) Your two viewpoints are not mutually exclusive.
 
4:35 PM
bah, I always make that mistake
and too late to edit
 
Anonymous
> There should be one-- and preferably only one --obvious way to do it.
 
I know Elendia is male, but first impressions last a long time XP
 
Anonymous
That doesn't mean that obvious way is the only way to do it - it just means that that's the obvious way.
 
@El'endiaStarman it actually looks pretty easy... as long as I stick to one particle.
 
Anonymous
It's perfectly fine to give users options, but there should be one obvious option for a scenario
 
4:37 PM
I mean, if you add "obvious", then sure, I'll agree. I think there should only be 1 way period :P
my way or the highway :P
 
Anonymous
There are dozens of ways in Python to do a loop N times. exec"code here;"*N is a favorite among golfers, but for i in range(N):code here is the obvious way.
 
that's a bit different. When you are looking to do a task, you should be presented with one option
so, if you had two ways to grab the current object from a loop
they definitely conflict
 
@NathanMerrill I had the same problem regarding Mauris Lynn. :P
 
actually, that might not be what I'm looking for... that's the wave equation, not the wave function.
 
actually, pytek question, if you do want to explicitly name a loop variable, how would you do that?
do you assign it to a variable?
that would be what I expect (and the best option IMO)
 
4:42 PM
@NathanMerrill \for[x](iterator) in Pytek is like for x in iterator in Python.
 
wait, how does that work?
like, add more code that uses x
 
\for[x](iterator){
  \print(x)
}
 
you know, it's actually kinda depressing how I know so little about programming. I just learn from tinkering with existing code to the point where I know what things I need to google to get stuff done, but I don't know things like style, efficiency, or non-spaghetti code
 
so, for is a function that takes an iterator, and a function?
and then calls the function with a bound variable?
 
The [x] is not strictly necessary, which allows you to just run a loop some number of times without needing to store the counter or anything in a variable.
@NathanMerrill Well, the {} is a code block, so it can have basically anything.
 
4:45 PM
Does it use an implicit variable, a la Perl's $_ ?
 
lets say I wanted to write my own for loop
\nathanfor
can I use the [x] syntax?
does my function take two parameters, an iterator and a "code block"?
 
@GabrielBenamy You can (will be) able to use _ as a "fill in the blank" concept, so you could actually do \for(iterator){\print(_)} to accomplish the same task.
 
alright
 
@NathanMerrill All functions can potentially have [options] syntax.
@NathanMerrill TBD, I guess, on how to specify that a function can or can't take options/arguments/code blocks.
 
right. And if I can take a code block, it sounds like I'd be able to define variables for the code block
because I'd need to read the x option, and say "create a variable with the name of "x" "
 
4:50 PM
Pytek should handle that assignment for you.
 
the assignment of x?
 
Correct.
Hmm, well...
 
but what if I have an option like reverse
and in my /nathanfor I'd still need to tell pytek which value to bind to x
 
\for is a special case of functions, so that automatic assignment may not happen in general, but I think it should be possible nonetheless to do so in the function definition of \nathanfor.
 
right, that's just a lot of magic that my function would need to do. Not to say it isn't possible :P
and that magic could be really useful
 
4:53 PM
hmmm....
 
like, I could say "my function takes a code block. You can use these variables to access X Y and Z"
 
if I were to write a language, I'd have every expression have the potential to evaluate to something useful.
 
@GabrielBenamy That's a lot harder than you think it is. :P (If I understand you correctly.)
 
(and not as useful either). Like, if you want for to mean something, and each to mean something, then foreach has to mean the combination of the two.
but it gets worse, because you want f, o, and r to all mean something
 
@El'endiaStarman Why? I would have print(stuff) evaluate to stuff, so you could chain operations. stuff = 5; print(2 + print(stuff)) would print 57. for would return an array consisting of the last expression in each iteration. Things like that.
 
4:56 PM
BTW @NathanMerrill Pytek does what you mentioned: \for(3)
 
@GabrielBenamy oh, you mean functional programming :)
every expression evaluates to a value
 
@GabrielBenamy That's different from what you technically said.
 
is that what functional programming is?
 
its a common trait
like, if you have a code block, it evaluates to the last statement in the code block
 
But anyway, I do aim to do that with Pytek, though perhaps not 100%.
@NathanMerrill This is the case with Pytek.
 
4:58 PM
That's kind of an F# thing more than FP specifically
 
Explicit \returns are technically unnecessary (if the thing you want to return is the last expression executed).
 
@NathanMerrill Something like that, yeah. In the case of loops, it would "collect" everything into an array and return that array. There may even be some sort of syntax to modify the array as it's being generated.
 
that everything is based on expressions
 

« first day (2181 days earlier)      last day (2663 days later) »