[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Home]
Board
Settings Home
/g/ - Technology



Thread archived.
You cannot reply anymore.



What are you working on, /g/?

Last most newly created thread: >>64122992
>>
File: haskell newbie.png (75 KB, 447x64)
75 KB
75 KB PNG
Learn the Haskell programming language

>>64131415
please use an anime image next time
>>
>>64131463
>please use an anime image next time
birds are anime
>>
>>64131463
>please use an anime image next time
Fuck off animefag.
>>
>>64131463
>please use an anime image next time
Unironically kill yourself
>>
>>64131463
Let's check
>lazy evaluation
still in
>prelude
still in
>arbitrary indentations
still in
nope.png

>>64131415
Thanks for using not anime. Today, OP wasn't a fag.
>>
>>64131570
lazy evaluation is good, having both lazy and strict is even better
prelude is better than most standard included libs

>>64131501
>>64131526
>>64131570
please don't turn this thread into a shitpost
1) 4chan is an anime imageboard
2) anime girls holding programming books, or engaging in programming, or similar things are a /dpt/ tradition
3) /g/ likes anime
if you don't like anime why not try an anime-neutral website like reddit?
>>
File: warggghh.jpg (19 KB, 196x185)
19 KB
19 KB JPG
>Anon, what's a monad?
>>
>>64131593
>prelude is better than most standard included libs
Given that other standard included libs are scripting memes that's a low bar.

also
>frogpostboard
>>
File: side effects.png (893 KB, 737x699)
893 KB
893 KB PNG
>>64131631
in Haskell you use them as a particular way of talking about effects while still remaining pure

they are:
a type constructor M
an instance of the monad typeclass (and hence applicative and functor typeclasses) Monad M, providing the functions:

return :: forall a. a -> M a
(>>=) :: forall a b. M a -> (a -> M b) -> M b
>>
>mixing strict and lazy evaluation without polarized types
>>
>>64131593
>lazy evaluation is good
not as default, as ghc demonstrates
>>
>>64131678
what are polarized types ,anon?
>>
Friendly reminder that J is the best functional programming language
>>
x86 assembly or Haskell? Which is more worthwhile?
>>
>>64131706
it doesn't demonstrate that though, people rely on laziness all the time
both strictness and laziness are good, and depending on what you're writing, a different default is more suited
in Haskell, since you use functional programming, function composition, streams, etc so often, laziness is a sensible default
in C strictness is a sensible default, even though you have short-circuiting for operators like &&, ||, etc (though when there are side effects this is different to Haskell)
>>
File: aputhinking.png (115 KB, 680x521)
115 KB
115 KB PNG
>>64131673

So Monads are a burrito?
>>
File: haskell.jpg (220 KB, 676x676)
220 KB
220 KB JPG
I wish FP would die already.
>>
>>64131742
why would you not learn both
>>
>>64131742
x86 is infinitely more useful.
Haskell is trash, don't use it.
If you want a good FP, learn Idris, Agda, F* etc
>>
File: side effects 2.png (220 KB, 851x87)
220 KB
220 KB PNG
>>64131742
learn both
>>64131758
no
>>
>>64131742
Haskell
>>
File: Prelewd.jpg (75 KB, 500x500)
75 KB
75 KB JPG
>>
>>64131871

DELETE THIS
HASKELL IS PURE
>>
>>64131714
Using types to parameterize over and mediate between evaluation strategies. Types are assigned polarities which essentially say whether their inhabitants are strict or lazy (for various evaluation orders such as call by value, call by name, call by need, etc.).
>>
>>64131931
how does that relate to data/codata? or is that the same?
>>
>>64131871
LEWD
>>
Training of my penis and pussy hentai generator should be done in at most 12 hours. The resolution of the output images will be 128x128. Next bit will be writing a script to use the generator to decensor hentai, and we will have the very first hentai decensoring program using AI!
Sample generated images: https://imgur.com/7vAS2Zm
>>
>>64131962
Same thing, really. Good observation.
>>
>>64131931
So how are they different or more useful than just assigning attributes to check against? Seems like unnecessary complexity.
>>
>>64131871
Imperative fags WISH their language was this cute
>>
>>64131991
does call by name have any benefit over call by need?
>>
>>64131463
Born in a world of Pajeets
Against the odds
We choose to code!
>>
File: find your Monado.png (38 KB, 503x60)
38 KB
38 KB PNG
>>64132026
>>
>>64131593
>1) 4chan is an anime imageboard
"4chan is a simple image-based bulletin board where anyone can post comments and share images. 4chan's collaborative-community format was inspired by one of the most popular forums in Japan, Futaba Channel. Different boards are dedicated to different topics, from Japanese anime, manga, and culture to videogames, music, and photography. Users do not need to register an account before participating in the community."
Notice it doesn't say simple image-based ANIME bulletin board. >>>/a/ is that way.

>2) anime girls holding programming books, or engaging in programming, or similar things are a /dpt/ tradition
Its been disputed tradition for years. The problem is that you NEET animefags have all day to wait and start a new thread with your stupid pictures.

>3) /g/ likes anime
"I know what everyone on /g/ likes because I like anime so /g/ must like it too!"

>if you don't like anime why not try an anime-neutral website like reddit?
If you don't like being called an animefag why not try necking yourself.
>>
>>64132061
look i get that you've got your own interpretation that the site is a website of immigrants and that it should be about immigrant culture and there isn't any inherent culture to the site itself but please take this to another board like >>>/j/
>>
30+ posts in and you're still arguing about the OP pic. for fuck's sake /dpt/ get it together
>>
c++ is the greatest language of all time
>>
>>64132122
hi Bjarne
>>
>>64132103
But we literally weren't for most of the thread. It was the first 3 or so posts and then the last 2 posts. That's 17%.
>>
>>64132061
>Bring this anal pained by a cartoon
>>
>>64132122
Agreed.

>>64132134
No, I'm Bjarne. That poster was Jason Turner.0
>>
>>64131994
Outside of pure languages like Haskell, evaluation strategy has the potential to influence a program's behaviour (i.e. non-determinism). Polarized types let you reuse all the other type machinery like polymorphism and whatnot to specify (if necessary) the assumptions about evaluation strategy a program makes. Also when you put it in the types it's automatic and you don't need to litter your code with things like `seq`.

I mean, types themselves are really just fancy attributes that you check, but it keeps everything simpler if you stay away from ad-hoc systems like what GHC has for strictness.

>>64132002
I believe the difference between call by name and call by need is that call by need has memoization. Haskell is call by need thanks to purity.
>>
>>64132188
Yes, but is there ever a use case for call by name over call by need?
Also, I think strictness or laziness patterns are quite adequate (though type level may be better as you say).
>>
>>64131463
Why does haskell have such autistic whitespace? Why can't I just use 8 space tabs like a sane person
>>
>>64132263
>8 space tabs
don't do that
>>
>>64132263
I think it would be better if GHC had an option that enabled tabs and gave them a particular number of spaces, like
-tabs=8
But I still think 8 space tabs are retarded.
>>
>>64132223
Call by name works better with effects (not talking about pig disgusting side effects here, but classical control effects like continuations). Call by need is just an optimization of call by name that assumes purity.
>>
>>64132310
I see
>>
>>64132122
this
>>
File: 1514959332046.png (40 KB, 172x183)
40 KB
40 KB PNG
>>64132061
>>
Is there a difference between setting fullscreen on my window vs. setting it on my direct3d swap chain?
>>
>>64131978
Thank you!
>>
no java is the best language
>>
>>64132582
weak
>>
neat https://github.com/jtv/libpqxx/releases/tag/6.0.0
>>
>>64132912
docs? what does it do, just a stdlib replacement?
>>
>>64132959
official C++ PostgreSQL API
>>
>>64132397
Windows windows doesn't have anything like full screen itself, so you must be using a wrapper library. In that case, I don't know, it probably does something like borderless windowed (maybe with a mode switch) instead of true full screen like you get with a swap chain.
>>
File: 1492831891533.png (341 KB, 556x561)
341 KB
341 KB PNG
>>64133061
>C++
Get that garbage out of here.
>>
>>64133094
Yeah I'm using SDL. It's a full mode switch but I didn't think SDL was creating anything since I wasn't using a renderer, hence the confusion.
>>
>>64133264
My guess is that SDL gives you borderless windowed mode. Using the swap chain to go full screen will give you exclusive full screen mode, which may be better for performance (and probably give you less latency).
>>
I'm a programmer deep into imperative programming.
I'm considering trying FP. But I'm not sure old dogs can learn to sit or that I'd be able to hold both types of thinking in my head effectively. Anyone have good perspective on this?
>>
I'd really like to play with Common Lisp after having a great deal of fun with The Little Schemer, but I'm having a hard time coping with the environment. The REPL scares me, and while emacs is neat actually using it feels like a cluster.
Can I treat LISP like I might treat Scheme, and write it and run it in two distinct parts, at least to get started?
help pls
>>
>>64133385
you can pick it up
what languages do you use
>>
>>64133310
Not that anon but I just quick checked the source and looks like you're right.
>>
>>64133538
C-like C++.
Embedded programmer. So it's not gonna be professionally relevant. I'm just interested. I've just felt that taking in other things leave me with too many questions a lot of the time and the insecurity in what's actually going on hurts for something that's supposed to be for fun. I'm suspecting something similar with FP. But I don't know because I haven't tried of course. So I'd like someones perspective.
>>
>>64133733
in C
use more higher level functions, i.e. taking function pointers as arguments
use discriminated unions where relevant

in C++
use more things like ranged for loop, ranged stuff when that comes out (think std::transform, std::accumulate)

if you knew C# i'd recommend F#
since you know C++ I recommend you try D
those are good intermediate languages
>>
>>64133830
>use more higher level functions, i.e. taking function pointers as arguments
Couldn't do that professionally but I could try that for hobby projects.
>ranged for loop
I don't recognize how this is functional in any way.
>try D
I've considered that. Maybe I should.
>>
is scala good? i think i can find excuses to use scala at work
>>
>>64133925
no.
Scala is awful.
>>
>What are you working on, /g/?
nothing, because i am not a stinking, sweaty, proletarist

carry on, plebs.
>>
Let's say I'm working in C# and I have an instance of a derived class as a reference to its base type, Object. I want to get a list of every public field and property on the actual derived class. That should be possible, right? Reflection or something?
>>
>>64134077
That's what reflection does, yes. What are you trying to do?
>>
damn, Vim's command is so weird.
I've been learning and memorizing vim's key for the last 12 hours, but it's really hard to get it.
Should I just abandon vim and stick to emacs for the time being, or should I learn vim for the "Portability" reason?
>>
>>64134135

atom
>>
>>64134116
I'm working on an extension for the Unity editor. The user can drag and drop anything derived from UnityEngine.Object into an editor field and I need to get a list of the public members of its actual type.
>>
>>64134172
Oh, good, you're actually using reflection properly.
>>
>>64134135
You'll have to work on remote files eventually, so learning basic commands is worth it so you don't have to deal with SSHFS or rsync/scp for minor stuff.
>>
I don't understand what haskell is for.
>>
>>64134135
Vim wastes your time, stop using it.
If you want to though, atleast use VS Code or another modern TE with vim keys so you only waste half the time.
>>
>>64134202
Research into lazy evaluation. EDSLs.
>>
Is there a ---simple--- way to get basic random numbers in c++? I just need a fucking random number from 1 to 3.

Even using the c libs and srand() and rand() I get the same number every fucking time even recompiling like wtf.

Just trying to make a fucking stupid rock paper scissors game.
>>
>>64133869
>I don't recognize how this is functional in any way.
if you rearrange the syntax:
for each x in xs
action(x);

xs.forEach((x) => action(x))
xs.forEach(action)

I recommend D as a starting point, because you'll do a ton of range operations
>>
>>64134256
Nigga seed your random number generator
>>
>>64134256
Are you seeding with the same value every time?
>>
Can somebody pls give me some LISP mascot r34?
>>
>>64134299
-> ~ ((()))
>>
>>64134276
you might as well use map/filter on slices, that way you could actually use them as values too.
>>
>>64134256
You need to pass a different seed to srand every time you need a new random number.
>>
>>64134298
Nah I used the time() function like in examples, I know I need a different seed.
>>
>>64134358
Huh. Post relevant code?
>>
>>64133515
Yes if you want.
>>
Might not be an actually answerable question but what language are most free software written in?
>>
>>64134574
make it precise
>>
>>64134574
C, unfortunately.
>>
>>64134574
C, fortunately.
>>
>>64134574
Not C++ unfortunately.
>>
>>64134584
>>64134660
delete these
>>
java has the best naming conventions

prove me wrong
>>
>>64134581
>>64134584
>>64134660
So what should I learn if might want to edit open source software but still want a job at some point? C or C++? The only programming knowledge I currently have is basic Java if that matters.
>>
>>64134704
org.omg.PortableInterceptor.ORBInitInfoPackage    
org.omg.PortableServer
org.omg.PortableServer.CurrentPackage
org.omg.PortableServer.POAManagerPackage
org.omg.PortableServer.POAPackage
org.omg.PortableServer.portable
org.omg.PortableServer.ServantLocatorPackage


Class AppConfigurationEntry.LoginModuleControlFlag
ModelMBeanNotificationBroadcaster
Interface JMXConnectorServerProvider


Java is basically the language to learn how not to name things.
>>
got my first app running on my phone through Android Studio

what should i make lads
>>
>>64134761
You should know C regardless.
>>
>>64134814
Any reason why? And which one should I learn first, even if I should learn C eventually?
>>
>>64134800
that's not even java

looks more like c#
>>
>>64134840
Not him but C is a good thing to learn next because it pretty much forces you to learn how memory is structured.
>>
>>64134843
literally https://docs.oracle.com/javase/7/docs/api/
>>
if Unix was written in Pascal instead of C, will the world have different viewpoint on programming?
>>
>>64134704
Tell that to my AbstractSingletonBeanFactoryInterface
>>
>>64134398
srand(time(NULL));
int num = rand()%3;


I seriously don't get why this doesn't work, pulled damn near straight from examples.
>>
>>64134857
But is it actually useful to write programs? I don't want to learn 3 different languages and end up only using one of them
>>
>>64134858
then theyre doing it wrong
>>
>>64134913
C might be worth learning, but even if it is I'd move on to Rust immediately after.
>>
is it legal to take an app and remake it? like if i took youtube and used its api to make an app that jsut searches for a video and plays it.
>>
>>64134913
>>64134945
>rust
he meant c++, the greatest programming language
>>
>>64134913
Yes it will make you better especially if you learn machine organization. Also you should really learn the basics of assembly as well not that you will actually code in it but being able to read it and understand that assembly is ultimately what is being run on your computer is important. If you just want to get good at a language though you should focus on that language. I can't even say what is the best language to learn because I have no job so maybe you don't want to even trust me.
>>
>>64134964
probably, look at minitube
>>
>>64134964
I don't think so but firefox used to play youtube videos even with the screen closed or another tab open but recently it seems that is no longer the case. I bet youtube threatened them for it so I would watch out because of their dumb little youtube red cancer.
>>
>>64134964
I think so. They already have that though, Newpipe.
>>
>>64134945
>>64134978
>>64134992
I don't know, to me it just sounds like everyone's suggesting the programming language that they like and not the one that would actually be the best for a beginner
>>
>>64135068
Well if you are a beginner just stick with java until you feel comfortable.
>>
>>64134901
that code is correct
how do you use num? You must be fucking up in the rest of the code
>>
>>64135068
if you're a beginner, it highly depends on what you want to do. Knowing C should be a goal for all programmers though, even if you don't use it that often, just so you don't take things for granted in whatever language you use.
>>
>>64135068
I fucking hate C but it's objectively an amazing language to learn as a beginner. It forces you to quickly become a master of the lowest levels of the computer, so that you don't write shitcode when you move on to higher-level languages.
>>
>>64135093
The problem though is num is the same every time without fail it is 1.
>>
>>64134901
Try this as a test, it works for me™:
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main( int argc, char* argv[] )
{
int i;
srand(time(NULL));

for( i = 0; i < 20; ++i )
printf(
"%i\n",
rand()%3
);

return 0;
}
>>
>>64135133
ah wtf I made a simple test program literally just calling those functions and printing result and it works fine
>>
>>64135150
forgot output
$ ./c_rand_test
2
0
1
1
1
0
2
2
1
0
2
1
2
1
0
1
2
1
0
2
>>
>>64135093
>>64135150
>>64135170
So I don't know what the fuck is going on but after I made a program that just calls that function and prints the value, now my other program works as intended with no fucking changes. Wtf??
>>
ok /dpt/, sepples question - which style is preferable if I have public functions that are unrelated to private class types.
class B;

class A
{
public:
void do_thing();
private:
B* b_;
};


or

#include "b.h"

class A
{
public:
void do_thing();
private:
B b_;
};
>>
>>64135220
idk maybe you just got the same value randomly 10-20 times in a row? Technically not impossible. If the other program really just started working without any changes to the code I don't know what other explanation there is.
>>
>>64131770
Don't insult cute catgirls like that kudasai.
>>
>>64135295
I mean maybe but I made slight changes to it and recompiled it a few times and still kept getting the same answer. I don't get it.

Oh well, works now I guess?
>>
>>64135356
Did you maybe forget to recompile one time when it was still broken?
>>
>>64132365
you mean *this
>>
>sepples will never have rng as simple as uniform(1,11)
>>
>>64135406
nice 1
>>
>>64135406
>>64135469
delete this
>>
>>64135433
Just make it yourself, it's only a few lines.
>>
>>64135504
don't have to because i don't use a shit language
>>
>>64135512
Enjoy your no performance.
>>
>Spectre is a more general attack, based on a wider range of speculative execution features. The paper describes using speculation around, for example, array bounds checks and branches instructions to leak information, with proof-of-concept attacks being successful on AMD, ARM, and Intel systems.
Dynamic and gradual typing fags BTFO.
>>
Brainlet here, I have a question about recursion.

//Prints the tree in alphabetical order

struct node {
node* left;
node* right;
char value;
} ;

// don't worry about this code
class Printer {
private ostream& out;
Printer( ostream& o ) :out(o) {}
void print( char c ) { out << c; }
}

// worry about this code
int printNode( node* root, Printer& printer ) {
// if there is no tree, do nothing
if( root == null ) {
return ;

} else { // there is a tree
printNode( root->left, printer );
printer.print( value );
printNode( root->right, printer );
}

Printer printer( std::cout ) ;
node* root = makeTree() ; // this function returns a tree, somehow
printNode( root, printer );


// Visual representation

k
/ \
h n
/\ /\
a j @ @
/\ /\
@ @ i @
/\
@@


Now, the main thing I don't understand is how "a" returns back to "h". Can someone kindly explain to me how that's possible on this example. This is braindead easy, I know, I just can't seem to grasp it.
>>
>>64135610
why did you wrap cout like that?
is this the power of object orientation
>>
>>64135610
That's what people mean by the "stack" all of your variables and function calls are put onto the stack. So when a finishes all of the information that a needs is popped from the stack and whatever called it, in this case h is now at the top again. If that was confusing I would look into the stack data structure because that is what it is.
>>
>>64135665
Honestly, I found this code on stackoverflow, I am not so knowledgeable on object oriented programming.
>>
>>64135693
>Honestly, I found this code on stackoverflow
that's basically how object oriented programming works so you're not far off
>>
>>64135735
DELETE THIS
>>
>>64135610
>>64135643
>>64135693
Rather than try to explain it, I refactored it to hopefully make it easier to understand:
struct node {
node* left;
node* right;
char value;
} ;

int printNode( node* root ) {
if( root->left )
printNode( root->left );

std::cout << value;

if( root->right )
printNode( root->right );
}

node* root = makeTree() ; // this function returns a tree, somehow
printNode( root );
>>
>>64135764
Goddamn C++ is beautiful.
>>
>>64135784
?
I guess it's technically C++ because it uses std::cout, but I'm not sure what makes it beautiful
>>
>>64135784
in haskell you would just do deriving (Traversable)
then traverse_ print (for free)
>>
>>64134463
I was asking to be spoonfed, but hearing that helped push me to find what I wanted. Thanks.
>>
>>64135668
>stack data structure
Now that makes a lot of sense. So that means that "a" didn't need to have a explicit "return" to return to "h", because once the last function(in this case "printNode(root ->right, printer"), it automaticly goes back to "h", because "a" gets "popped off" from the stack. This is my current visual representation.
            ___
_|a_|__
__|__h__|_
| k |

AFTER A IS DONE:

______
_|__h__|_
| k |



Anyways, thanks a lot anon. I think I am getting the grasp of it.
>>
>>64135764
Aren't you missing the base case? I may be wrong, I am a newbie after all.
  

if( root == null ) {
return ;



Other than that, your code does look much cleaner than the one I posted.
>>
>>64135858
Pretty much yep. It's important to remember that because even scope is built on the stack although I don't know if you have learned about scope yet or not?
>>
>>64135917
Yes, but you'd only need to check the root returned by makeTree().
>>
>>64135928
I have a vague understanding on scope. By scope, do you mean the parts of the program/function, where a variable/function can be used? Again, thank you for your time anon.
>>
>>64135995
Yep exactly. Even for an if statement if you declare a variable within an if statement and exit the if statement that variable is "popped" off of the stack and no longer reachable.
>>
File: 10le6d.jpg (110 KB, 1080x1081)
110 KB
110 KB JPG
>>64135735
>>
>>64131415
Currently learning how the fuck you're meant to use visual studio.
Are all the cpp and header files just meant to be floating about the directory? Is there no include or src folders?
What IDEs have include/src folders? This is not manageable.
>>
>>64135992
Awesome, thanks for cleaning that up, anon. I have to spend some time into learning C++.
>>
>>64136069
what does it matter how the files look in the directory?
you're supposed to manage the layout within the IDE
>>
File: dog-jent.jpg (17 KB, 480x360)
17 KB
17 KB JPG
>>64136051
Great! Anon, I can't thank you enough, so please accept this dog as a small token of my appreciation.
>>
>>64136075
This seems to be a pretty good video explaining recursion & stacks & such https://www.youtube.com/watch?v=Mv9NEXX1VHc
>>
File: e29.jpg (298 KB, 1733x2000)
298 KB
298 KB JPG
>>64136145
That video is super legit! Thanks a lot, anon. I don't have another dog in my folder, would a wolf anime girl suffice for now?
>>
>>64136127
No problem. It's fun explaining the concepts anyways.
>>
>>64136199
Momiji is totally fine. Also I'll shill TheChernoProject on YouTube again, he does good C++ explanations. He starts with some setup videos, but if you can already compile & run programs I'd start with "How C++ Works."
>>
Anyone know how to re create Intel bug?
>>
u32 rng(u32* rng_state) {
*rng_state = (*rng_state * 65539U)&0x7FFFFFFF;
return *rng_state;
}
>>
>>64136266
Sweet! I am suscribing as we speak, thanks anon, hopefully C++ is just as enjoyable as C. Cheers!
>>
>>64135356 >>64135390 >>64135295 >>64135220 >>64135150 >>64134901 >>64134398 >>64134358 >>64134298 >>64134256
I'm too lazy to look to which post I need to reply
Friendly reminder to, whenever you counter weird bugs like this, reboot your computer
>>
>>64136332
>whenever you counter weird bugs like this, reboot your computer
thanks grandpa
>>
>>64135433
1 d 11;


Simple.
>>
/dpt/ I wonder if any of you can implement a random number generator that generates normally distributed numbers using only random number generators that generate uniformly distributed numbers in the range 0 to 1.
>>
{-# LANGUAGE GADTs #-}

import Data.Text (Text, pack)

data Choose a1 a2 r where
L :: Choose a b a
R :: Choose a b b

-- if given L, then out = String
-- if given R, then out = Text
itoa :: Choose String Text out -> Int -> out
itoa L x = show x
itoa R x = pack (show x)

five :: Text
five = itoa R 5

five' :: String
five' = itoa L 5
>>
>>64136710
now use type lits to index a list

Choose '[String, Text, Float] 2
>>
hardest thing you ever worked on?
>>
>>64136742
no crude jokes please
>>
>>64136742
concrete floor
>>
>>64136766
>>64136753
What is the most challenging computer programming project that you have ever worked on?
>>
>>64136708
It's been a while since I took statistics.
>>
>>64136734
Without using type literals:
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}

data Choose xs o where
C0 :: Choose (x, xs) x
CS :: Choose xs x -> Choose (y, xs) x

pattern C1 = CS C0
pattern C2 = CS (CS C0)

three :: Choose (Int, (Float, (String, ()))) o -> o
three C0 = 3
three C1 = 3.0
three C2 = "3"
>>
>>64136834
Nice
>>
>>64136834
also there's a bug on GHC 8.0.* that prevents this, but if you aren't on that you could do
pattern C2 = CS C1
pattern C3 = CS C2
etc
>>
>>64136798
programming is not difficult
if a programming project is difficult it's because it involves doing math that hasn't been done before or something of that nature
in which case it was the math that was difficult, not the programming
>>
>>64136904
Oh, that's a good idea.
Today I learned how to use data kinds:
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeOperators #-}

data Choose :: [*] -> * -> * where
C0 :: Choose (x ': xs) x
CS :: Choose xs x -> Choose (y ': xs) x

pattern C1 = CS C0
pattern C2 = CS C1

three :: Choose '[Int, Float, String] o -> o
three C0 = 3
three C1 = 3.0
three C2 = "3"
>>
>>64136931

>tfw want to make a big project
>tfw no idea how to start it
>>
>>64136994
now make it polykinded (purely because you can)
>>
>>64137027
though you need PolyKinds
>>
>>64137027
data Choose :: [k] -> k -> * where
C0 :: Choose (x ': xs) x
CS :: Choose xs x -> Choose (y ': xs) x
>>
>>64137075
what about

Choose '[Show, Ord, Eq] c -> (forall a. c a => a -> r) -> r
>>
What is the best programming language for birds?
>>
>>64137101
needs RankNTypes and ExistentialQuantification
>>
>>64137101
I can implement a function with that signature, but I'm not sure if it's possible to apply it while utilizing "c" in any meaningful way
>>
>>64137167
Yeah, I just mean it as a "pick one of these constraints, and there exists a value of a type that satisfies it"
>>
>>64137165
The number of extensions is approaching the number of lines of actual code
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeOperators #-}

data Choose :: [k] -> k -> * where
C0 :: Choose (x ': xs) x
CS :: Choose xs x -> Choose (y ': xs) x

pattern C1 = CS C0
pattern C2 = CS C1

wtf :: Choose '[Show, Ord, Eq] c -> (forall a. c a => a -> r) -> r
wtf C0 f = f 3
wtf C1 f = f True
wtf C2 f = f "false"
>>
>>64137182
If you use the extension TypeInType, you get Type : Type (whether or not you want that) but you also get PolyKinds, KindSignatures and DataKinds

You can do multiple pragmas on one line too

{-# LANGUAGE A, B, C, D #-}
>>
>>64136708
sum 20 Xi~U[0,1]

that's basic as fuck, why would anyone not know it mong
>>
>>64137103
lisp
>>
>>64136199
Where can I get more momiji??
>>
File: screm.jpg (13 KB, 320x240)
13 KB
13 KB JPG
>>64137103
screm
>>
>>64137020
one step at a time :^)
>>
>>64135068
There is no "best language for a beginner". Beginners don't really learn their first language anyway because they don't have the frame of reference to understand what its nature as distinct from other languages is. Pick literally any language.
>>
just started android studio i have a hello world app running but after looking at the structure of the files and all the code, im still not sure where to begin. How to add images, inputs, text, events, etc?
>>
https://mf4.xiph.org/jenkins/view/opus/job/opus-tools/ws/man/opusenc.html

I can't figure it out. How would I get it to have .ogg extension?
>>
When you're teaching yourself how to program, is there a such thing as going to fast or making good pace? I can't tell if I'm taking on too much or if I'm really learning the concepts enough before moving on
>>
I wrote a scraper for zeemaps.
I combined the data with my omegle thing that screenshots and logs their location, now their info from zeemaps will pop up too. It's pretty nice.
Where else can I datamine people?
I have a youtube scraper that I used on Terry Davis' youtube channel to gather info on /g/ but that wasn't really useful data.
I dunno, here it is.
Anything I could do better?
import os, requests, json


database=[]

map_id = input('What map do you want to scrape?').split('group=')[1]
url ='https://www.zeemaps.com/emarkers?g='+map_id+'&k=REGULAR&e=false'
step1 = requests.get(url).json()

for anon in step1:
step2 = requests.get('https://www.zeemaps.com/etext?g={}&eids=[{}]'.format(
map_id,
anon['id']
)).json()
anon.update(step2)
database.append(anon)
print(anon['nm'])

print('anons scraped, downloading media and sorting')

db_len=len(database)

for num, x in enumerate(database):
print(num,db_len,x['nm'])
path=os.getcwd()
path+='\\'+x['ad']['country']
path+='\\'+x['ad']['state']
path+='\\'+x['ad']['city']
path+='\\'
if not os.path.exists(path):
os.makedirs(path)

with open(path+str(x['id'])+'.txt', 'w') as f:
f.write(json.dumps(x))

temp=[]

if 'zeemapsimages.s3.amazonaws.com' in x['i']:
for url in x['i'].split("'"):
if 'amazonaws' in url:
## print('http:'+url)
temp.append('http:'+url)
temp=list(set(temp))
for media in temp:
download = requests.get(media, stream=True)
with open(path+media.split('/')[-1], 'wb') as f:
for chunk in download.iter_content():
f.write(chunk)
>>
File: shapetsm.png (153 KB, 1256x1698)
153 KB
153 KB PNG
I have a bunch of 2D shapes, i want to take the shortest path to traverse all of them. I think what im looking for is point of entry and exit for the shapes and the order of them.

There must be a type of traveling salesman that solves right? Any tips how to do this? Some related papers or gits would be fine too.
>>
Are "traditional", C arrays used at all in C++? Or are vectors/array templates usually used?
>>
I've been trying to connect to a db using host, port and SID but it gives me an error. Is there a basic tool on windows that permits me to try this kind of connection and output decent error messages to find out why I can't access it ?

I literally want to try something like jdbc:oracle:thin:@host:port:SID
>>
>>64140265
depends are you writing the retarded "new faggotpus way" or are you writing the retarded "orthodox shitty sepples".
>>
>>64140265
Follow the teachings of wise men: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rsl-arrays
>>
>>64140265
All the time. Although you can use std::array if you want.
>>
>>64140113
pls reply
>>
>>64140265
Better to use std::array to get rid of the stupidity of decay.
>>
Can anyone recommmend good programming communities for someone that really wants to advance his knowledge?
>>
How do I remove Grub and put the Windows boot loader back on?
>>
>>64131631
A monad is just a monoid in the category of endofunctors.
>>
>>64140598
>good programming communities for someone that really wants to advance his knowledge
/dpt/. We're very knowledgeable. Our community is rife with language developers, embedded systems professionals, corporate recruiters, genius-level programming experts who just can't get hired because literally every job requires 15 years of experience, and lots of Type Theory professors.
>>
>>64140254
>I have a bunch of 2D shapes, i want to take the shortest path to traverse all of them.
Find all the intersection points. These are the nodes of your graph. The shape segments between them are the edges. Then use some kind of travelling-salesman-inspired heuristic approach because the problem is NP-hard.
>>
>>64140254
>>64140765
Looks like your problem has a name:
>https://en.wikipedia.org/wiki/Route_inspection_problem
>the Chinese postman problem (CPP), postman tour or route inspection problem is to find a shortest closed path or circuit that visits every edge of a (connected) undirected graph.
>>
File: 1506112612488.png (127 KB, 601x508)
127 KB
127 KB PNG
>>
>>64135549
>Dynamic and gradual typing
wait what does that have to do with anything?
>>
>>64140598
/dpt/, very knowledgeable, filled with geniuses and extremely welcoming ! Most are NEET by choice so they can spend more time helping the rest of the community !
>>
>>64140765
The intersections are not important.
I might have not been clear. I want to traverse the shapes by not interrupting the path i take while im traversing a shape. Say i start with the circle. I move along the arc but i dont bother with other objects intersecting it, i only leave the path when im done with the circle. From there i move to the next shape, which shapes start point is not necessarily an intersection.

>>64140794
The shapes might be closed but the path i take does not have to be.

It feels like the distance of entry/exit points between the shapes determine the shortest path. But the closest entry/exit point position changes depending on the previous shapes entry/exit point. So the path length between the shapes are a function of entry/exit points positions.
This shit is getting out of hand.
>>
>>64140937
>haskell_user.jpg
>>
File: shapetsmd.png (26 KB, 932x688)
26 KB
26 KB PNG
>>64140960
This is how id imagine the graph of the pic >>64140254
The distance of the start point and the closest point of entry/exit of every shape is known, these are the blue lines.
But the shortest path between the shapes are not exact, it changes depending on where i enter the shape, these are the black lines, which are functions.
>>
>>64140946
They insert potentially exploitable dynamic checks to guard against undefined behaviour instead of just not having the incorrect code at all.
>>
>>64140960
>i only leave the path when im done with the circle
>From there i move to the next shape, which shapes start point is not necessarily an intersection
If you're doing one shape at a time, and you don't necessarily start at an intersection point when you cross from shape to shape, then you're basically asking how to draw shapes, and implying that drawing a circle and then a square traverses a different path length than drawing a square and then a circle.
>>
>>64141037
>They insert potentially exploitable dynamic checks to guard against undefined behaviour
That's not what your quote says. Your quote says speculative execution that ignores bounds checking can be exploited (presumably, only when the code is incorrect).
>>
>>64141037
>>64141101
This doesn't impact gradual typing in any way. The solution is trivial: don't elide bound checks unless the user (optionally) provides enough information to prove that it's correct.
>>
does anyone here actually have any idea what speculative execution means?
>>
>>64141101
>>64141129
>>64141158
Scratch that. I was confusing speculative execution with speculative optimization.
>>
>>64141101
>>64141129
The vulnerability is in speculative execution of incorrect code (e.g. the success branch of a bounds check). When the conditional finally makes it far enough down the pipeline to roll back and take the failure branch, speculative execution may have already caused normally protected data to leave traces in the cache or other parts of the processor (just not in main memory).
>>
>>64141189
>The vulnerability is in speculative execution of incorrect code (e.g. the success branch of a bounds check).
You're right. I thought you were referring to some form of speculative optimization that JIT compilers have control over. Then it downed on me you're talking about (I presume) things like branch prediction.
>>
>>64141216
It's a hardware issue compounded by the software shortcoming.
>>
>>64141229
>It's a hardware issue compounded by the software shortcoming
It doesn't affect correct code, from what I understand, and I'm pretty sure Haskell is as vulnerable as Javascript, because neither one provides you with a means to prove that reading an arbitrary index doesn't trigger out-of-bounds access. So it's more like:
>not using a dependent typing system to formally verify all instances of array access BTFO
>>
>>64141292
I consider using dynamic checking instead of static verification gradual typing.
>>
>>64141292
why are you trying to make comments about this bug when you have literally no idea how it works?
I mean you could just look it up for a bit first, it'd take you like ten minutes probably
>>
>>64141058
The order of closed shapes doesnt change the path length i think. I dont know how this could be proved or disproved. But if we have a line or line segment to draw, the order might matter. The end which i enter the line segment matters for sure.

Assume we have a fixed order. The position of starting points of the shapes change the path length.
>>
>>64141320
>I consider using dynamic checking instead of static verification gradual typing.
I'm not in the mood for arguing semantics, so I'll just note that nobody else shares your view, probably because it renders every program that isn't fully formally verified in every respect "gradually-typed".
>>
>>64141336
>why are you trying to make comments about this bug when you have literally no idea how it works?
Not an argument. You're the one who doesn't understand how it works at this point if you think speculative execution around an unnecessary bounds check affects anything, or if you think you can't access out-of-bounds indices in most statically-typed languages (and you're lucky if you even get a runtime check at all).
>>
>>64141292
>>64141320
>>64141410
And it does affect correct code that relies on dynamic checking to prevent undefined behaviour.
// a is an array of length n
// there is a secret stored in memory next to a
// i is an index >= n
if i < n {
// speculative execution bypasses kernel protection so speculatively executing the wrong branch doesn't crash your program even though the right branch keeps going
let x = a[i];
// the secret may have been leaked to the cache!
// will have no effect in the end
print(x);
} else {
// eventually we will get here
print("bounds check failed");
abort;
}
>>
File: 1484791637890.png (918 KB, 870x720)
918 KB
918 KB PNG
Wait I don't get it.
Even if I do a bound check, the data can still be accessed, loaded into the L1 cache, and only after that the CPU realizes it's wrong so it does the correct jump needed ?
WTF, is that how it always works ? Why do we do this, I mean the CPU did all those instructions and memory fetching only to realize it was wrong and backpedal. How can this benefit any program with conditions (i.e. a lot of programs) ?

Also how do you optimize your code then ? It's hard enough to know the internals of your language, even harder to know what's happening at the OS-level, but you actually also have to take into account all those special behaviors from the CPU ?
>>
>>64141410
the fucking state of this place...
>>
>>64141347
>The order of closed shapes doesnt change the path length i think. I dont know how this could be proved or disproved.
Tell me if I'm understanding correctly: you want to traverse your shapes one by one, ignoring all other shapes until the current shape is done. When you're done with one shape, you can start any other shape from any point, regardless of where you finished on the last shape.
>>
>>64141466
Thats correct.
>>
>>64141445
>it does affect correct code that relies on dynamic checking to prevent undefined behaviour
If your program produces an out-of-bounds index and then tries to use it for a read, it's because your program is incorrect. If you're talking about "defensive" programming (where functions that don't know how they will be called do runtime sanity checks), I don't consider programs that trigger these defenses to be correct. If you're talking about validating external input, then all bets are off. I guess you could statically prove correctness without running into the issue if you always clamp or wrap around the index in addition to issuing some error message.
>>
>>64141446
>Even if I do a bound check, the data can still be accessed, loaded into the L1 cache, and only after that the CPU realizes it's wrong so it does the correct jump needed ?
Yep, it's done because modern processors have deep pipelines (high throughbut but also high latency). If the CPU waited for the result of a condition before continuing down the correct branch, it would slow everything down.

>Why do we do this, I mean the CPU did all those instructions and memory fetching only to realize it was wrong and backpedal. How can this benefit any program with conditions (i.e. a lot of programs) ?
The CPU doesn't speculatively execute the whole branch, it just goes until it knows the result of the condition. If it predicted the correct branch, it just keeps going. If not, it aborts, rolls back the changes (not all the changes, though, like if the code made some data enter the cache).

>Also how do you optimize your code then ? It's hard enough to know the internals of your language, even harder to know what's happening at the OS-level, but you actually also have to take into account all those special behaviors from the CPU ?
In the worst case, if you write code that thrashes the branch predictor, you get the same performance as if there was no branch prediction at all. So you can only go up from there! State of the art branch predictors are very advanced and basically learn from the branches your program takes at run time to make better predictions in the future, and can even detect some periodic behaviour. Best way to help the branch predictor is to try to make your repeated conditionals use the same branch many times in a row or follow a simple pattern (e.g. for an if statement, TTFTTFTTF...).
>>
>>64141456
>still no argument
>>
>>64141446
when a CPU executes code, it first has to load instructions from memory then feed them through a pipeline before it can execute them
since the pipeline is something like 20 instructions long, you have to know which instructions to fetch 20 instructions in advance
if it hits a conditional branch, it can't know which instructions to feed into the pipeline until it evaluates the condition, which means it needs to stop and waste time waiting until it knows which code is going to be executed next
there are however ways that the processor can guess which way the conditional jump will go - this is called branch prediction
when the processor makes a guess it speculatively executes whichever bit of code it guessed was most likely to come next
if the guess was right, which it most often is, then the speculative execution saved it the time that it otherwise would have wasted
if the guess was wrong, it throws away all the speculative execution and starts again with the other branch - this is called a branch misprediction

the reason this benefits programs is that the total time that would be wasted waiting to figure out which branch to load exceeds the total time wasted when the branch predictor guesses wrong
>>
File: cs.png (81 KB, 942x739)
81 KB
81 KB PNG
#include <iostream>

using namespace std;

int main()
{
int i;
cout << "Enter your height in cm" << endl;
cin >> i;
if (i >= 182 && i <= 210)
cout << "Nice bro" << endl;
else
if(i <= 181 || i >= 211)
cout << "End yourself" << endl;


return 0;
}
>>
>>64141610
undefined behavior central
>>
>>64141494
>Thats correct.
In that case, the order you draw the shapes doesn't matter, because the sum of the path lengths remains constant. If the shape loops, it doesn't matter what point you start, because you will always pass through every point on the shape before you reach your starting point. If the shape doesn't loop, you should start from one end and go until you reach the other. It doesn't matter which one you start from.
>>
>>64141610
do you have a manlet chart for girls too
>>
>>64141574
Anon, it's not very productive to enter a discussion about vulnerabilities with "just write correct code LMAO". The point is that dynamic checks don't actually offer safety (like I believed before learning about this, and is the assumption that languages like Rust make) without giving up even more efficiency than previously thought necessary.
>>
Do you (and how) attribute credits to some open source library you used if you gutted it and took bits and pieces here and there from it?
>>
>>64141610
There's no need for that second if. Also Your indentation makes it look like else { if (...) { ... } } but it's actually else if (...) { }
>>
>>64141591
>>64141583
> pipeline
I didn't knew about that, it all makes more sense now, thanks ! I thought instructions were just kinda of hardcoded "paths" in the CPU, which you'd feed it one instruction at the time.

> State of the art branch predictors are very advanced and basically learn from the branches your program takes at run time to make better predictions in the future, and can even detect some periodic behaviour.
It can do that ? It's all hardware, this is physically implemented on silicon, right ? That's so fucking crazy.
>>
>>64141746
just rewrite it slightly and change the wording of the comments a bit
did you learn nothing from high school?
>>
>>64141819
I'm rewriting it from scratch in fact. I just don't want to be scummy
>>
File: shapetsmc.png (18 KB, 921x598)
18 KB
18 KB PNG
>>64141673
Say order doesnt matter, how do i determine the starting points?
>>
>>64141746
I just mention it.
>"heavily inspired from [...]"
>"all credits got to [...]"

But I'm a NEET who lacks self-esteem and doesn't really like taking credits from something I didn't do from A to Z myself. So yeah...
>>
>>64141574
>>64141737
Safe programs are not necessarily correct programs, basically. It's better to let Pajeet's shitty code crash than it is give Vasily access to your passwords. The issue is that, if you don't slow Pajeet's code down even more, Vasily could still get you.

Doesn't have to be Pajeet code either, even the greatest of us make mistakes and don't necessarily have the time or energy to statically verify everything. It would be bad engineering to leave out dynamic checks in privileged applications just in case, but it turns out it's still a vulnerability.
>>
>>64141816
branch prediction is some very interesting technology
at first it would just guess that any backwards jump was probably a loop and would probably be taken, and any forwards jump was probably an if statement and you can't really guess
then they started using state machines to record which way the branches went in the past to guess better in the future
AMD's latest ryzen processors allegedly use an "artificial intelligence neural network" (or so their marketing material calls it) to predict branches, but I'd hazard a guess the reality isn't nearly as exciting as that makes it sound
https://en.wikipedia.org/wiki/Branch_predictor#Implementation
>>
>>64141737
>it's not very productive to enter a discussion about vulnerabilities with "just write correct code LMAO"
I wasn't arguing that at any point. I'm saying that the problem isn't limited to dynamically or gradually typed languages. Any language is vulnerable to this, including advanced statically typed ones. As far as the type system is concerned, a correctly implemented bounds check is a proof that no out-of-bounds access will happen. You'd need a type system based on some kind of non-deterministic logic to get around this.
>>
File: Koala.jpg (763 KB, 1024x768)
763 KB
763 KB JPG
>>64141860
>not prefacing your every function with bibtex references
>>
>>64141756
Thanks for the correction, professor.
>>64141690
IMO girls below 165 are womanlet.
>>
>>64141904
>Any language is vulnerable to this, including advanced statically typed ones.
Nope, the advanced statically typed language wouldn't produce code that could ever even lead to speculative execution of bad stuff.

>As far as the type system is concerned, a correctly implemented bounds check is a proof that no out-of-bounds access will happen. You'd need a type system based on some kind of non-deterministic logic to get around this.
Um, no, not at all. Can you verify (i < n)? If so, you can verify array access.
>>
>>64141839
>how do i determine the starting points?
Do you have some data structure representing the shapes, or are you working with plain bitmap data? If the former, then you can start anywhere on the circles, and start from one of the end points of the polygonal chains. If the latter, then you'll need some kind of shape detection algorithm.
>>
>>64141964
>advanced statically typed language wouldn't produce code that could ever even lead to speculative execution of bad stuff.
Absolutely false, as I've just explained, because even advanced static type systems don't have a concept of "speculative execution".

>Can you verify (i < n)? If so, you can verify array access
1. You can't generally verify this. I've already given you examples of that, and even potential ways to get around it
2. A bounds check is a proof that no out-of-bounds access will happen. If your type system can't grok this, it's primitive.
>>
how can anyone think shadertoy is useful holy shit

if you can even load a demo without your browser crashing or getting artifacts it's some ray tracing/ray marching bullshit and a ton of code that takes too long to read and is unusable for "real" applications because it takes too much resources to compute
>>
>>64142318
>how can anyone think shadertoy is useful holy shit
It's useful for creating pretty demos and testing things out. What did you think it was intended for? You're just jealous because you can't into ray-marched sphere-hopping.
>>
>>64133925
sorry, anon, but >>64133944 is absolutely right
Don't let anyone fool you. Scala is terrible. It will murder your parents, spread disease and poison the village well.

srspost tho, it's got its pros and cons
Build tools
- slow-ass compile times
- slow-ass process startup
+ sbt is an all-in-one tool that can make shit work OOTB
- sbt is a complex-looking tool that's caused at least a bit of controversy in the community
- ridiculous sbt startup time

REPL
+ has a REPL
- REPL was bare-bones, peeps working on fixing that up in Dotty
+ Ammonite REPL
- Ammonite REPL reports your shit to Jewgle* (*actually uses GA to report stats to dev)
~ can disable Ammonite GA w/ a command-line parameter, or just strip it out with a simple diff (clone, patch, build with a single command): https://www.reddit.com/r/scala/comments/6irnix/about_ammonite_tracking_and_why_i_wont_use_it/dj8v39y/

Misc
+ can reuse java libs
- warts here and there due to java/JVM compat requirements
- some libs more abandoned than Kotlin's (ScalaFX vs TornadoFX)
- very questionable situation wrt android
+ scalajs

But it's the first thing I reach for for small tasks. Only if it fails me, do I switch back to Python (ecosystem), C++ (perf), etc.

As for your workspace, it depends:
1. Doing it as a "what's best for the company is the highest(only) priority!" bootlicker? Well, look at where it's the right tool for the job, propose, execute.
2. Doing it for your own continuing education (as most IT professionals should do)? Look at where it won't cause too much damage to the company, your career/reputation/social capital; plan CYA risk/damage control measures, propose, execute.
>>
>>64142361
i just want to see some procedural texture generation that's actually useful. this ray marching in fragment shader shit is not how real graphics applications like games work
>>
>>64142406
>this ray marching in fragment shader shit is not how real graphics applications like games work
"Real" graphics applications just can't into bi-harmonic trilinear simplex-based cone-scanning because vidya is by and for plebs like you.
>>
>>64134135
>damn, Vim's command is so weird.
in the beginning, most of them seem weird, yes. Later, fewer of them seem weird.
>I've been learning and memorizing vim's key for the last 12 hours, but it's really hard to get it.
No shit. Don't learn in the least efficient way possible. Pace yoself nigga. Learn one concept at a time, give yourself breaks, eat, sleep and exercise sufficiently to not handicap your brain. Otherwise you'll find it many times harder than needed, think Vim sux balls and go complaining on some bolivian tapestry forum.
>Should I just abandon vim and stick to emacs for the time being, or should I learn vim for the "Portability" reason?
Eh, the usual "it'll make you a better develope^Wtext manipulator" truism applies. Realistically, if you feel like it - go for it, but again, make the process enjoyable to maximize the chance of succeeding.
Priorities-wise, if you'll need it once every two weeks and it'll save you 10 min compared to nano, the gain ain't that much. If you need to hop boxen more often, or nano's babby UI infuriates you enough, that's a good reason to learn slightly more powerful UIs.
>>
>>64134887
I assume you're aware of http://www.projectoberon.com/
>Basically there were no programs, only modules (strong typed dynamic libraries).
>Any procedure/function that had a special type signature could be called from the CLI environment, UI action, or after selecting an UI element, depending on the way the mouse buttons were used.
>>
>>64142386
thanks anon. this client has its own scientists who have written down an algorithm in messy scala. there are lots of ways i can go with this; as a matter of business i don’t care what we do
>>
Just got all my advent of code solutions running in my own compiler
>>
>>64136479
explain
is this some fancy user defined literal
or just a non-sepples lang? if so, which one?
>>
>>64142752
#define d + Dice{} + 
// declare operator overloads for + and a Dice object

It's fucking stupid
>>
>>64142786
doesn't look like a complete self-contained example, m80
>>
File: 891489381231283.png (770 KB, 720x734)
770 KB
770 KB PNG
2 spaces for indentation or 4?
>>
>>64140660
anyone?
>>
>>64142861
2 for webdev, 4 for programming.
>>
>>64142904
Google it m8, also >>/sqt/
>>
>>64142547
oh boy, I forgot to even start on that angle
Scala has a bit of a community separation, the main tard factions being
- "This part^WJava company sucks. I wish I was at home smugcoding Haskell abstract algebras" type theory autists
- "Java++ show bobs vagene" pragmatists
we'll ignore the SJW CoC fags for the purposes of this discussion

>this client has its own scientists who have written down an algorithm in messy scala.
how messy we talking here?
at least a potential refactoring (if deemed effective use of time/risk/human/etc resources) should be easier than a dynamically typed mess

>there are lots of ways i can go with this; as a matter of business i don’t care what we do
cool, so what are some of the options you're considering?
>>
>>64142904
format your entire drive, install windows
>>
>>64142940
psh amateur
throw away the drive, buy a new one and install windows
you never know if those loonix terrists haven't infected your firmwares
>>
>>64142966
that's why you microwave a drive after you format it
>>
File: udk ui.png (16 KB, 758x285)
16 KB
16 KB PNG
What the fuck is "opaque cache" and "low-grain invalidation"?
https://docs.unrealengine.com/latest/INT/Programming/Slate/Architecture/index.html
>>
>>64143014
>Design for developer efficiency where possible. A programmer's time is expensive; CPUs are fast and cheap.

That's right you filthy consumers, now quit complaining about "muh lag" and "computer can't keep up with my typing"
>>
>>64142979
SOP, really
>>
What is a repl?
>>
>>64143243
read-eval-print loop.

A prompt for you to interactively run statements in your language.
>>
What's the server-side language I should be using in current year?

I've been writing a thing in Python, it's been going pretty well. It's mostly talking to clients on TCP sockets and operating a Redis database.
But potential performance problems in the future worry me. So I want to find a replacement language that can leverage lots of asynchronous socket connections and not choke.

Any suggestions?
>>
>>64143286
>But potential performance problems in the future worry me.
Nigga Instagram uses Python. Are you going to grow beyond Instagram?
>>
>>64143243
>>64143250
nah, yer thinking of rep'n
it's what the danish call shit like snickers and mars bars and stuff
>>
>>64143286
common lisp
>>
>>64143243
A useless tool popularized by Lisp and functional languages that wastes your time.
t. someone who loves FP.
>>
>>64143286
as you seem to cleverly anticipate very important Maserati problems that'll never be an issue for your project, the obvious solution is to use MongoDB as a storage layer to reach peak webscale at the small cost of occasionally being write-only
>>
>>64143296
>>64143341
I just want more requests per second, you dorks. I'm not Instagram-scale, and never will be. Doesn't mean I want to write and host inefficient software.
And I also just in the mood to learn a new language.
>>
>>64143386
>I want to find a replacement language that can leverage lots of asynchronous socket connections
sounds like you're falling for the async meme
also known as JS cant into multithreading
go on then, dive into the elegant beauty of callback hell that is Node.js
>>
>>64143419
>JS is the only language that uses concurrency and async
>stop close
>>
test
>>
>>64143386
You're just doing what NEETs here love that explains their NEETdom: not finishing a project and switching to another language because you're bored already. Then rinse and repeat. I think the performance thing is just an excuse. Anyway, it's your call: I've heard good things about Go.
>>
>>64143440
>pretends NodeJS's entire shtick wasn't "you can shit out JS in the backend now, also async event driven magic cures cancer"
>>
>>64143477
nail on the head. What I'd expect of someone who has no or useless professional experience (read NEET or junior "dev")
I should know, that was me back in the day.
"It's not a phase, dad!" Sure thing kid, now go play with your Node
>>
>>64143331
>t. someone too stupid to understand how to utilize a REPL
>>
>>64143479
you're missing my point.
node doesn't mean async itself is bad.
>>
>>64143419
Not all async is callbacks, first of all. There's not a single callback in my current code (several thousand LOC, if that means anything).
Also, there's no alternative when you need to handle a lot of sockets.

>>64143477
>>64143500
>being simultaneously mean and retarded
what is a hobby, friends? Do you finish and ship your hobby projects? Or do you just have fun writing cool things in your free time, without caring about time spent or whether you'll ever actually release it?
That's what I'm doing.
Please keep your prejudice under control, your hubris is showing.
>>
>>64143560
>Do you finish and ship your hobby projects? Or do you just have fun writing cool things in your free time, without caring about time spent or whether you'll ever actually release it?
Not the mean anon, but I can tell you that I used to do the latter for a very long time, and at some point it gets extremely depressing when you look back and see nothing of value has been accomplished.
>>
>>64143500
>I should know, that was me back in the day.
We all know, I think. That's why it irks me so much. When I look back when I was unemployed and doing toy projects for myself I can't believe how many hours I lost learning some new meme language or library instead of picking a few and focusing on them. Or just wasting time installing yet another Linux distro. At the end you have nothing to show because you don't finish any project. Meanwhile people that do it right keep building their portfolio. You are basically putting yourself at disadvantage willingly.
>>
>>64143585
Yeah, I've read blog posts from people who've been doing stuff for years and none of it turned into anything of use.
The problem is expectation. I'm not expecting anything out of my free-time projects, yet I enjoy it and it broadens my horizons a bit. So it's overall a positive experience for me, even though I'm not building the next big thing in my garage or something.
>>
>>64143649
>The problem is expectation. I'm not expecting anything out of my free-time projects, yet I enjoy it and it broadens my horizons a bit.
I'm telling you, I used to think exactly like you, up until I hit my mid 20s (after programming for ~12 years) and realized how much time was lost that could've been spent on doing something both interesting and useful, and that I don't have nearly as much time anymore.
>>
File: 93489123481329.jpg (9 KB, 480x360)
9 KB
9 KB JPG
>>64143712
>I'm telling you, I used to think exactly like you, up until I hit my mid 20s (after programming for ~12 years) and realized how much time was lost that could've been spent on doing something both interesting and useful, and that I don't have nearly as much time anymore.
>>
>>64143615
>You are basically putting yourself at disadvantage willingly.
>>64143712
>realized how much time was lost that could've been spent on doing something both interesting and useful

Why are you here then, anon? Be the change you want to see -- stop shitposting and go min-max your life to victory.
But most importantly, let other people live their life how they want (e.g. by not min-maxing every moment of their waking hour), especially when you literally know nothing about their life in the first place.
>>
New thread!

>>64143860
>>64143860
>>64143860
>>64143860
>>64143860
>>64143860
>>
>>64143788
> Why are you here then, anon
I already have a stable job. So it doesn't worry me as much as it should to some of you.
>>
>>64143883
>I already have a stable job
AND WHY DO YOU THINK I DON'T
please refer to my previous prejudice advice
>>
>>64143788
>Why are you here then, anon?
Because I just don't have a drive to actually program in my free time anymore.

>let other people live their life how they want
I'm not telling you/him/whomever how to live. I'm just pointing out that this premise:
>The problem is expectation
Is false. Also, you're apparently too fucking stupid to realize that it's not about any specific person, but a general observation that just because something seems intuitively true to you now doesn't mean it'll seem that way 5 years down the road.
>>
>>64143788
>straw man argument
>>
>>64143883
>>64143907
It's not even about having a stable job. If your long-term vision of a meaningful life is to work your ass off making some software corporation richer, maybe you're on the right track just writing toy programs.
>>
>>64143712
>realized how much time was lost that could've been spent on doing something both interesting and useful, and that I don't have nearly as much time anymore.
the strat is willful distraction for me, with the occasional moments of >>64143780




Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.