[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 345
Thread images: 36

What are you working on, /g/?

Old thread: >>59228724
>>
>>59233375
IIRC you can cast away the const in Rust though.
>>
>>59233391
It's not like anyone's ever gonna do important things with it.
>>
>>59233370
Thanks for using a thanks for using a thanks for using a
>>
>>59233391
Yeah, via unsafe, but you aren't supposed to use usafe in your everyday code.
>>
>>59233412
With what?
>>
Why are C toddlers dumb?
>>
>>59233479
If you're so good why aren't you making yourself useful and doing anything other than posting here? There are dozens of things we could be doing right now that would be massively more beneficial than Eternal Bikeshedding on /dpt/
>>
>>59233479
LOOOOL CTARDS BTFO!!!!!
>>
File: 1476859986037.jpg (69KB, 775x837px) Image search: [Google]
1476859986037.jpg
69KB, 775x837px
>tfw finally getting haskell

ama
>>
Daily reminder that OCaml, F# and Scala are the only usable functional programming languages and the Haskell cult only shows how little /g/ knows about the industry and programming in general.
>>
>>59233479
>>59233529
AHAHAH C Babies are dumb, dumb!
>>
>>59233549
>C Babies
C toddlers*
>>
Is Boost++ cancer?
>>
>>59233548
>If I keep posting that it'll make it true!
>>
>>59233556
No C is
>>
>>59233547
what weren't you getting earlier?
>>
>>59233547
I hope you're learning Haskell only to switch to Idris latter, otherwise it's a waste of time.
>>
Hello, expert C programmer here.

How can I average two integers? Using C if that matters.

PS: I'm using C btw
>>
>>59233557
But it is anon. Name any other fp language with more industry adoption.
>>
>>59233547
how do you like your monads?
>>
>>59233548
>OCaml
Trash.
>F#
Trash.
>Scala
Fucking trash.
>>
>>59233573
>Name any other fp language with more industry adoption.
I don't know why you think this is relevant. I bet you also believe in democracy.
>>
>>59233576
>I don't like getting things done
Typical /dpt/.
>>
>>59233567
I was reading Read You A Haskell for Great Good, which is a TERRIBLE FUCKING BOOK

Started reading Functional Programming using Haskell by Richard Bird, and it cleared shit up.

>>59233574
not there yet, desu, the book is kinda dense and explains everythign in detail.

>>59233568
why? elaborate.
>>
>>59233569
Change Int to float, average them, change back to int. easy.
>>
>>59233443
Using unsafe is fine if it's a final resort. It doesn't really endanger the safety of the rest of the program because it lifts very few rules off, and it's meant as an annotation to the consumer.
>>
File: 9781784398224.png (55KB, 810x1000px) Image search: [Google]
9781784398224.png
55KB, 810x1000px
>>59233573
JavaScript.
>>
>>59233576
What's not trash?
>>
File: what the FUCK.png (9KB, 335x107px) Image search: [Google]
what the FUCK.png
9KB, 335x107px
Can somebody tell me what the FUCK is going on here
>>
>>59233581
It is because that's what the post was about.
>>
File: Cucked_so_hard,jpg.png (855KB, 1366x768px) Image search: [Google]
Cucked_so_hard,jpg.png
855KB, 1366x768px
>>59233590
>change back to int.
>change a float back to int

Why are C toddlers so dumb?
>>
>>59233586
Who are you quoting?
>>59233598
I don't know of such a language yet. Haskell is garbage too, but not as as bad as those three.
>>
>>59233597
Javascript confirmed for best language, C toddlers btfo!!!
>>
File: 19361937913013.png (7KB, 233x193px) Image search: [Google]
19361937913013.png
7KB, 233x193px
>>59233598
>>
>>59233569
You add (+) the integers together and divide (/) them by two (2).
>>
>>59233606
Oh?
And what happens when any of a or b equals to INT_MAX or INT_MIN?

?
???
?
>>
>>59233611
Disgusting trash
>>
>>59233601
learn about IEEE 754, nigger, you can't directly compare floats
>>
>>59233615
so

4 + 5 = 9 has an average of (9/2=) 4?
?
??
?
>>
Pure functional languages are not as widely useful and easy to use as traditional languages that let you pick the right paradigm for the job, whether it be declarative, imperative, object-oriented or functional, such as Python, Ruby to a lesser extent, Rust, Jabosgript, Kotlin, Lua
>>
>>59233622
I'm not directly comparing them nigger

(defn approx=
"Tests two values for approximity within 1e10^-10."
[x y]
(> 0.0000000001 (abs (- x y))))

(defn coll-approx=
"Tests two collections of values for approximity within 1e10^-10."
[xcoll ycoll]
(= (count (filterv #(= % true) (map approx= xcoll ycoll)))
(count xcoll)
(count ycoll)))
>>
>>59233628
In C yes.
>>
>>59233589
> why? elaborate.
I was merely memeing. Still though, Idris has real dependent types while SPJ have spent the last 10 years trying to make GHC to emulate them with 50 different extensions. You should really check it out one you are confident with your Haskell.
>>
>>59233629
You can't do pure FP in any of those languages.
Most of those languages are shit at FP.

So much for multi-paradigm/.
>>
File: 1486376698114.jpg (88KB, 1280x720px) Image search: [Google]
1486376698114.jpg
88KB, 1280x720px
Is there a language which uses sets as its core data structure? Preferably without IO.
>>
>>59233629
I agree but imperative and functional are the only sane paradigms, unless you use OOP for a very restricted entity-component-system design.
>>
>>59233636
>>59233636
>>59233636
>>59233636
I thought you expert C kernel hacker masters could produce that"bug free" code unlike Rust noobs :D
>>
>>59233639
dependent types aren't yet necessary
idris has a lot of flaws, particularly syntactically and in terms of patterns, e.g. (->)

>>59233589
there's a wikibook too
>>
>>59233629
>right paradigm for the job
>object-oriented
Only if the job is to somehow make the project more shittier.
>>
>>59233639
>I was merely memeing.
Fuck off back to your subreddit. Never mention anything related to Idris in your posts ever again if you want to use "meme" in such a reddit manner.
>>
>>59233664
Did someone shit in your coffee?
>>
>>59233629
You have clearly never used a functional language in production.
>>
>>59233664
idris >> your trash
>>
>>59233667
Yes. That, dare I say "person", I replied to in my previous post.
>>
>>59233641
You can't disagree that map/filter/reduce and list comprehensions are useful while programming in those languages.
>>59233645
>>59233658
Maybe not classical object-oriented programming, but Rust shows how it is useful to group data with methods and also use typeclasses for polymorphism.
>>59233671
Not an argument. Have you?
>>
File: programming socks.png (338KB, 1140x813px) Image search: [Google]
programming socks.png
338KB, 1140x813px
[x] Tiling WM
[x] Programming socks
[x] Hate IDEs
[x] Hate Ubuntu
What else do I need to become a master programmer?
>>
>>59233687
Program in C and hasklel
>>
>>59233630
I can't say anything about precision, because it shows only 7 numbers after dot
>>
File: 1461855737131.jpg (209KB, 600x582px) Image search: [Google]
1461855737131.jpg
209KB, 600x582px
>>59233680
>Idris >> Idris
What were you trying to say here exactly?
>>
File: what the FUCK 2.png (4KB, 195x82px) Image search: [Google]
what the FUCK 2.png
4KB, 195x82px
seriously what the shit
>>
>>59233685
>You can't disagree that map/filter/reduce and list comprehensions are useful while programming in those languages.
map/filter/reduce are not the entirety of functional programming
>>
>>59233651
>there's a wikibook too
What, something like Real World Haskell?

>>59233639
>I was merely memeing.
wew lad

Can someone help me with this?

data Nat = Zero | succ Nat
deriving (Eq, Ord, Show)
(xx) :: Nat -> Nat -> Nat
m xx Zero = Zero
m xx succ m = (m xx n) + m

(^^) :: Nat -> Nat -> Nat
m ^^ Zero = succ Zero
m ^^ succ m = (m ^^ n) xx m

factsu :: Nat -> Nat
factsu Zero = succ Zero
factsu (succ n) = succ n xx fact n


[1 of 1] Compiling Main             ( dat.hs, interpreted )

dat.hs:6:8: error: Parse error in pattern: succ
Failed, modules loaded: none.
>>
>>59233685
>typeclasses
>polymorphism
>somehow the same as POO
Fucking jump off a bridge already.
>>
>>59233692
That was an amazing demonstration of backpedaling, weaboo jones. Keep if up and make /g/ proud.
>>
>>59233700
>>59233589

https://en.wikibooks.org/wiki/Haskell


Data constructors have to begin with uppercase letters

Succ
>>
>>59233688
Um, that returns me a float for two integers, kernel hacker master

pls show me a correct way
>>
>>59233709
What are you even on about? Where exactly did I "backpedal" in any of my posts?
>>
>>59233688
The solution is to check the & of the lowest bit for carry and add it if it exists to the sum of the >>1 shifted results of both numbers.
>>
>>59233687
small mechanical keyboard
>>
>>59233723
>in any of my posts?
take your reddit culture to your subreddit
>>
>>59233729
>promote to double before division
Most unexpectedly expensive operation though.
>>
>>59233697
Stop comparing floating point numbers for equality. Alternatively, you can go full retard and do
(= (to-string result) (to-string [0.9148))

, because this is what you're trying to do here.
>>
>>59233747
>>59233630
>>
>>59233700
>>59233715
Oh, and xx is a combination of characters, not symbols, so it will not be interpreted as an infix operator.
If you want to infix something made of characters, put it in backticks.

xx :: Nat -> Nat -> Nat
m `xx` Zero
m `xx` Succ m

(^^) is fine though, that's interpreted as an operator


...
factsu (Succ n) = Succ n `xx` fact n
>>
>>59233739
>reddit """"""culture""""""
I want to see the reasoning why you're not from reddit, which you obviously are.
>>
>>59233752
And why do you think 0.0000000001 is big enough to make a difference?
>>
>>59233764
Because you thought I am seeing your trip/name when I have anonymized every poster, reddit trash
>>>/r/ibbit
>>
>back to le reddit xD
>lmao he programs in a GC'd language noob noob idiot noob
>le C(ancer) toddlers Cx
>fuck u retard i dont have any arugment moron idiot retarded
>etc etc
Seriously are these threads so shit? Can't we just talk about actual programming?
>>
>>59233774
>>59233691
>>
>>59233715
I was stuck on this for an hour.

>>59233758
I'm fixing this right now.
[1 of 1] Compiling Main             ( dat.hs, interpreted )

dat.hs:3:1: error:
Invalid type signature: (xx) :: ...
Should be of form <variable> :: <type>
>>
>>59233785
What are your favorite striped socks?
>>
File: floating_point.png (13KB, 911x186px) Image search: [Google]
floating_point.png
13KB, 911x186px
>>59233789
>>
>>59233790
>>59233758

data Nat = Zero | Succ Nat
deriving (Eq, Ord, Show)
xx :: Nat -> Nat -> Nat
m `xx` Zero = Zero
m `xx` Succ n = (m `xx` n) + m

(^^) :: Nat -> Nat -> Nat
m ^^ Zero = Succ Zero
m ^^ Succ n = (m ^^ n) xx m

factsu :: Nat -> Nat
factsu Zero = Succ Zero
factsu (Succ n) = Succ n `xx` fact n


[1 of 1] Compiling Main             ( dat.hs, interpreted )

dat.hs:9:18: error:
Ambiguous occurrence ‘^^’
It could refer to either ‘Prelude.^^’,
imported from ‘Prelude’ at dat.hs:1:1
(and originally defined in ‘GHC.Real’)
or ‘Main.^^’, defined at dat.hs:8:3
Failed, modules loaded: none.
>>
File: what the FUCK 3.png (15KB, 334x203px) Image search: [Google]
what the FUCK 3.png
15KB, 334x203px
>>59233747
Then why the fuck does it work here?

(defn sigmoid
"The sigmoid function: S(t) = 1 / (1 + e^-t)"
[t]
(/ 1 (+ 1 (math/expt Math/E (- t)))))
>>
>>59233700

Goddamn, Haskell looks ugly..
>>
>>59233825
holy fug
>>
>>59233833
Yeah that's the point but this will be wrong if both numbers are odd, so you still have to check for carry on the first digit.
>>
>>59233829
okay, so I infix'd (m ^^ n) to (m `^^` n).

[1 of 1] Compiling Main             ( dat.hs, interpreted )

dat.hs:9:19: error: parse error on input ‘^^’
Failed, modules loaded: none.
>>
>>59233829
(^^) is defined in prelude, so it's a duplicate definition

What you can do is this:

{-# LANGUAGE NoImplicitPrelude #-}
module Main where
import Prelude hiding ((^^))
>>
>>59233849
But how did you know that was me? What kind of redditry is this? Are you using some sort of browser addon?
>>
>>59233833
>the average of 1 and 1 is 0
>the average of 1 and 3 is 1
>the average of 5 and 5 is 4
C toddler strikes again.
>>
>>59233855
^^ does not need infixing, it is already an operator.

The problem is that there's already a function called (^^) in Prelude

Using >>59233860 you can hide that pre-existing function.
>>
Is today the day when redditors tell redditors GTDO to reddit in 4chan /dpt/?
>>
>>59233872
>>59233860
Thanks!
>>
>>59233866
kek

I don't even think C toddler hacker masters of /g/ can make a bug and exception free hello world program
>>
What language lets me to place comma as a decimal point?
>>
>>59233901
These are binary and my point is 10e-10 is too small to be a viable delta in approx float comparisons.
>>
>>59233913
why not use a decimal point?
>>
>>59233913
Shit ones
>>
ITT:
plebbit
c toddler
stripped kneesocks
memeskell
>>
Why do I never see Clojure in /dpt/?
>>
>>59233931
you have to go back.
>>
>>59233643
>Preferably without IO.
Just do pure math then, you have sets and convenient notation for them.
>>
>>59233952
Because Lisps are dead.
>>
>>59233963
But I need an evaluator and type-checker. Compilation to native code would be nice too.
>>
>>59233988
You could use Haskell and the containers library (which includes Data.Set)

just avoid IO
>>
>>59233988
>Compilation to native code
>Without IO
>>
>>59233988
What would be the point?
Without IO you can't interface with the program, can't give it data, can't see any data.

Do mathematics and use peer review.
>>
>>59233997
Haskell is stained with IO though. I heard it even refuses to compile if you don't have a main function with an IO signature.
>>59234010
So?
>>
So I wrote a little conditional to print things like "1st" or "32nd" or "11th", given the numbers 1, 32, and 11 respectively.
Am I missing something?

printf("%d%s\n", num,
(num == 11
|| num == 12
|| num == 13
|| (
(num % 10 != 1)
&& (num % 10 != 2)
&& (num % 10 != 3)
)) ? : "th" :
(num % 10 == 1) ? "st" :
(num % 10 == 2) ? "nd" :
(num % 10 == 3) ? "rd" : "th. <-- An error happened here, btw.");


I haven't tested this yet.
>>
>>59234021
>Without IO you can't interface with the program, can't give it data, can't see any data.
Why would I care about that?
>peer review
It's too slow and I'm just on my own. How would I even get my stuff peer reviewed?
>>
>>59234024

> I heard

At least try to have a valid argument.
>>
>>59234024
You can just write a library and load it into GHCI.
>>
File: 1488199951880.jpg (162KB, 1537x896px) Image search: [Google]
1488199951880.jpg
162KB, 1537x896px
why doesn't terry start a gsoc project and expose younglings to templeos?
>>
>>59234050
>implying anyone other than Terry unironically uses TempleOS.
>>
>>59234038
>Why would I care about that?
Then a computer program is useless for you.
>It's too slow and I'm just on my own.
It's your only option I'm afraid.
>How would I even get my stuff peer reviewed?
Write papers and send them out for publication.
>>
>>59234039
Are you retarded?
[1 of 1] Compiling Main             ( noIO.hs, noIO.o )

noIO.hs:1:1: error:
The IO action ‘main’ is not defined in module ‘Main’

>>59234043
But I need native code too. And doesn't GHCI do some IO stuff by default ?
>>
>>59234073
I don't think you actually understand anything you're talking about.
>>
>>59234079
if I remove that first part, it'll print things like 11st and 12nd, which is wrong.
>>
>>59234071
>Then a computer program is useless for you.
I don't think so.
>It's your only option I'm afraid.
Well, what I asked in the initial post is another option.

>Write papers and send them out for publication.
Where should I send them to? Do they accept papers from anyone or what?

>>59234083
I think the opposite is true.
>>
>>59234095
On second thought, just ignore this, I must be retarded.
>>
>>59234106
>I must be retarded.
I agree.
>>
File: LibVirt.png (53KB, 1200x675px) Image search: [Google]
LibVirt.png
53KB, 1200x675px
Has anyone used libvirt for something useful?
>>
>>59234073
use ghci

:l name
>>
>>59234063
there was an anon who made a lot of additions to templeos. i would also like to contribute or atleast do something useful with it.
>>
>>59234050
le ebic CIA nigger man xD
>>
>>59234099
>I don't think so.
What possible useful function could a computer program without IO achieve?
>Where should I send them to?
Depends on the subject matter.
>Do they accept papers from anyone or what?
If it's good, yes.
>>
>>59234119
That's IO. Loading the file is itself an IO action, isn't it?
>>
>>59234120
Terry doesn't want you to. He's so proud of having done everythin himself, even the bootloader.
>>
>>59233860
>>59233872
So this is my program now:

module Main where
import Prelude hiding ((^^))

data Nat = Zero | Succ Nat
deriving (Eq, Ord, Show)
xx :: Nat -> Nat -> Nat
m `xx` Zero = Zero
m `xx` Succ n = (m `xx` n) + m

(^^) :: Nat -> Nat -> Nat
m ^^ Zero = Succ Zero
m ^^ Succ n = (m ^^ n) `xx` m

factsu :: Nat -> Nat
factsu Zero = Succ Zero
factsu (Succ n) = Succ n `xx` fact n


[1 of 1] Compiling Main             ( dat.hs, interpreted )
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-unknown-linux):
initTc: unsolved constraints
WC {wc_insol = [W] fact_a2fZ :: t_a2fY[tau:1] (CHoleCan: fact)}

Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>>
>>59234099
If your program does no IO, then what does it do?
Even if you compiled functions that aren't called or used, how could you call or use them?
>>
>>59234149
> ghc: panic! (the 'impossible' happened)
Haskell in a nutshell.
>>
>>59234149
I'm a retard, I wrote "fact" instead of "factsu".

just ignore that.

>>59234158
no.
>>
>>59234165

fyi these error messages are terrible, even worse than usual
>>
>>59234169
>than usual
what's that?
>>
>>59234165
Oh, and you don't have a Num instance, so you can't use (+).

add :: Nat -> Nat -> Nat
-- todo

m `xx` Succ n = add (m `xx` n) m
>>
>>59234117
I consolidated my employer's old servers into 1 powerful server running libvirt+QEMU.
>>
>>59234142
>What possible useful function could a computer program without IO achieve?
It would do whatever I tell it to do in the program, just without any IO.
>Depends on the subject matter.
I think it can be easily inferred from the posts I made.
>If it's good, yes.
I don't even have a basic education though.

>>59234155
>If your program does no IO, then what does it do?
Depends on the program. Currently I just want something which can do basic operations on sets.
>Even if you compiled functions that aren't called or used
Why would they be not called? Some functions call themselves by definition.
>how could you call or use them?
My functions will call other functions written in my program or in the standard library of whatever language I'm using.
>>
>>59233370
how do i become an expert in C++ in a week

i'm a python programmer
>>
>>59234196
You realise that printing to the console is IO?
That reading from the console is IO?
That the only difference between a program that does no IO, and no program, is that one uses up more computer resources?
>>
>>59234208
>You realise that printing to the console is IO?
Yes.
>That reading from the console is IO?
Yes.
>That the only difference between a program that does no IO, and no program, is that one uses up more computer resources?
That isn't really true. One of them might compute something.
>>
>>59234222
>That isn't really true. One of them might compute something.
As I said, uses up more computer resources.
You won't know the result.
>>
>>59234203
You can't become an expert anything in a week just because you know something else that you might think is similar to the thing you want to learn. You may learn the basics quickly, but that doesn't make you an expert.
>>
>>59234207
explain your reasoning.
>>
>>59234207
no, python programmers are the master race, but i need to come down and learn C++ although I'm aware it's an inferior language
>>
>>59234203
It's highly unlikely that you become an expert in a week, or even in months. The thing with C++ is no one agrees what is "good" C++ and everyone uses different flavors because the language is just that big.
>>
>>59234196
>It would do whatever I tell it to do in the program, just without any IO.
But what would be the point in executing it?
Without IO there's no difference between running the program and not running it.
Hence my suggestion of just doing mathematics.
>I think it can be easily inferred from the posts I made
Mathematics and computer science are huge fields, you're gonna have to be more specific.
>>
>>59234234
>>59234227
then i guess i'll just go fuck myself
>>
>>59234178
>>59234149
Worked.

module Main where
import Prelude hiding ((^^))

data Nat = Zero | Succ Nat
deriving (Eq, Ord, Show)
xx :: Nat -> Nat -> Nat
m `xx` Zero = Zero
m `xx` Succ n = (m `xx` n) `add` m

(^^) :: Nat -> Nat -> Nat
m ^^ Zero = Succ Zero
m ^^ Succ n = (m ^^ n) `xx` m

add :: Nat -> Nat -> Nat
m `add` Zero = m
m `add` Succ n = Succ(m `add` n)

factsu :: Nat -> Nat
factsu Zero = Succ Zero
factsu (Succ n) = Succ n `xx` factsu n

main :: IO ()
main = return ()


[1 of 1] Compiling Main             ( dat.hs, interpreted )
Ok, modules loaded: Main.
>>
>>59234233
>C++
>inferior to Python
Kill yourself
>>
>>59234229
In the logic system I'm using this is an axiom.
>>59234233
>no, python programmers are the master race
If something can be the "master race" while stile being a shit-eater, sure.
>>
>>59234196
>It would do whatever I tell it to do in the program, just without any IO.
So, nothing?
>>
>>59234247
It is, honey.
>>
>>59234222
>One of them might compute something.
A result you can't ever see.
>>
>>59234247
no u
>>
>>59234222
>One of them might compute something.
Yeah, and then throw the result away. Completely fucking useless.
>>
>>59234225
>As I said, uses up more computer resources.
Yes, but it also does compute something.
>You won't know the result.
So?

>>59234251
I don't know why you think "computing something" and "nothing" are the same thing.

>>59234257
>A result you can't ever see.
I fail to see how this is supposed to be relevant.
>>59234265
>Yeah, and then throw the result away.
Not necessarily.
>>
How can I make a graphical program in C++

I've used curses in the past but it's a bit ghetto and I don't want to touch QT because it's an untouchable monolith
>>
>>59234245
You should try writing a num instance

You won't be able to use negate (because they're natural numbers) but you could write

instance Num Nat where
fromInteger n | n < 0 = error "Negative numbers not supported"
fromInteger 0 = Z
fromInteger n = S (fromInteger (n - 1))

(+) = add
(*) = xx
(-) = todo
abs = id -- all nats are positive
signum Z = Z -- signum of zero is zero
signum _ = S Z -- signum of a positive non-zero is one


after doing this, you'll be able to use

>+
>*
>-
>integer literals
>>
Post
>a) your programming language history in chronological order

C64 BASIC
MOS 6502 Assembly
C
x86 Assembly
C++
Java
LISP
Prolog
Python
PHP
Scala
ARM Assembly

>b) the two languages you earned the most money with
C++
Java
>>
>>59234278
gtk
>>
>>59234277
>I fail to see how this is supposed to be relevant.
So just skip the step of running the program, it's gonna save you a lot of time (and energy costs)!
>>
>>59234278
>How can I make a graphical program in C++
Qt.
> I don't want to touch QT because I'm retarded
Oh, I don't know then.
>>
>>59234277
>Not necessarily.
Yes, necessarily.

>>59234289
oh, and

negate n = error "Cannot negate a nat"
>>
>>59234294
a)
C(ancer)
C(ancer)++
x86 assembly
Haskell
Lisp

b)
Haskell
x86 assembly
>>
>>59234277
>"computing something" and "nothing"
The thing is without IO you can't even be sure the computation finished.
>>59234278
>How can I make a graphical program in C++
Do you mean a windowed GUI or something more like a surface on which you draw things? I'm assuming first since you mention curses and Qt. I feel like Qt is really not that bad, did you at least try using it?
>>
>>59234294
a)
>HTML & CSS - junior programmer
>javascript - junior programmer
>emails - project manager

b)
>HTML & CSS
>>
>>59234277
Why compute anything when you can't even know the result of your computation?
What's the fucking point? You don't gain anything from it.
>>
>>59234278
>How can I make a graphical program in C++
GTKMM is an idiomatic C++ GUI toolkit, but it's limited compared to Qt while it pretends not to be. The documentation sucks.

FLTK is also idiomatic C++. It looks ugly but it's nice to use. FLTK is minimal and it doesn't pretend to be anything else.

I suggest FLTK.
>>
>>59234324
>Haskell
What kind of profitable software have you written using Haskell?
>>
>>59234294
>a) your programming language history in chronological order
ZX-Spectrum BASIC
Z-80 Assembly
Turbo Pascal
Lisp
Delphi
C++
x86 Assembly
C#
Python
Haskell
Rust

>b) the two languages you earned the most money with
C++
C#
>>
>>59234304
>So just skip the step of running the program
Why? Then it won't compute anything.
>it's gonna save you a lot of time (and energy costs)!
I can afford it.
>>59234325
>The thing is without IO you can't even be sure the computation finished.
I can make a pretty good guess though.

>>59234327
>Why compute anything when you can't even know the result of your computation?
Is this the only thing it's possible to gain from computing something?
>>59234341
>Why do you want to compute something for the sake of computing something?
That's not what I said.
>What are you going to do with that data?
Well, that would depend on the data, wouldn't it?
>>
>>59234336

FLTK looks good

I'm basically gonna use it to input tweaks without recompiling
>>
>>59234289
>>59234310
I'll try that.
>>
>>59234348
Something for the military, it's classified. We were using both Haskell and assembly.
>>
A few weeks back I asked about any free-to-use XML/REST apis for weather, but the only one that lets me request for data without signing up is NOAA. I was hoping to find one for any worldwide requests. Does anybody know of any that allow me to get this information for free? It doesn't have to be detailed, just a temperature and a general overview of the day.
>>
>>59234377
lmao

kys larping faggot
>>
>>59234294
>a) your programming language history in chronological order
Pascal
x86 asm
C
C++
PHP
Javascript
Python
C#
Forth
avr asm

>b) the two languages you earned the most money with
C and avr asm - the only job I've had as a programmer has been as an embedded developer for atmega mcus.
>>
>>59234387
Nope, I don't know why exactly would one need sets for benchmarks.
>>
>>59234384
Why without signing up specifically? I use the open weather map, you need to sign up but it takes a few second and you get an API token that you can use.
>>
>>59234390
How do you get that from what I said?
>>
are there any books or articles i should read on devising goals for agents? ive got a turn based board game simulation im working on, and im trying to flesh out the AI.
>>
>>59234351
>Why? Then it won't compute anything.
There's no way for you to distinguish 'computing something' and 'not computing anything at all'.
>>
>>59234410
>military
>classified.
4/10
>Haskell and assembly.
>Haskell
you almost got me, buddy
>>
What's the best type of pants to use for programming? I use jeans at the moment but I've been thinking about changing to chinos as the fabric breathes better
>>
>>59234430
This might be the use case:
>use Haskell for top critical safety provable source code
>proceed to fuck it up by shitposting assembly on top
>>
>>59234434
full rick
>>
>>59234443
>use Haskell for top critical safety provable source code
> ghc: panic! (the 'impossible' happened)
>>
>>59234434
Skirt + striped socks
>>59233687
>>
>>59234351
>I can make a pretty good guess though.
You couldn't even pur down any probabilities or confidence intervals on your trials because it's physically impossible to distinguish a successfully computed result from a non-successful one.
Technically you can't run any program at all because all real computers always emit some form of IO, be it electromagnetic noise or heat.

>Is this the only thing it's possible to gain from computing something?
Yes.
If you're not interested in IO, executing computer programs are not for you.
>>
>>59234294
>a) your programming language history in chronological order

Sinclair BASIC
Pascal
C
C++
C#
Scheme
Emacs Lisp
Common Lisp
Python
JavaScript
Tcl

>b) the two languages you earned the most money with
C
Tcl
>>
>>59234468
>im 16
Bye, bye.
>>
>>59234468
>no job cuz im 16
you're done for
>>
>>59234430
Pretty much any software in that field will be classified.
>Haskell and assembly.
I don't see any problem here, you can use inline assembly in Haskell.
>>
Do you think looking into the flaws of other languages I don't use, instead of improving in a language that I do use, is a healthy habit to do in my spare time?
>>
>>59234496
> you can use inline assembly in Haskell
No you can't.
>>
>>59234496
You can also write compilers of domain-specific languages to assembly in Haskell.
>>
>>59234497
Of course. You want to make sure you're not wasting your time on an inferior language.
>>
>>59234468
>im 16
LONDON
O
N
D
O
N
>>
>>59234473
>it's physically impossible to distinguish a successfully computed result from a non-successful one.
It's possible though, if the program logic itself was correct then obviously there will be a successfully computed result.
>Technically you can't run any program at all because all real computers always emit some form of IO
I didn't claim that I want an OS without any IO. I just don't want my program or the language to have any IO.
>electromagnetic noise or heat
How the fuck is that "IO"?

>Yes.
No.
>If you're not interested in IO, executing computer programs are not for you.
Says who?
>>
>>59234532
>No.
Yes.
>Says who?
Her
>>
>>59234511
Yes you can, not directly, but you can through the FFI.
>>
>>59234402
In the event that I may release this program I'm writing, I was trying to eliminate the overhead of people having to sign up for a web service like Open Weather Map. If I don't find anything, I may end up having to ask the user for their token and get the information that way.
>>
>>59234351
>Is this the only thing it's possible to gain from computing something?
Yes.
>>
>>59234543
>Yes.
No!
>>59234553
>Yes.
No.
>>
>>59234545
That's not inline assembly though.
>>
>>59234553
You can know the state a Turing machine was in without looking at its working bands.
>>
>>59234468
>deleted
kek
>>
>>59234532
I don't understand what your problem is? Just don't put any IO in your program. There does not exist a programming language without IO, but you can choose not to use the IO functions.
>>
>>59234532
>It's possible though
How?
>if the program logic itself was correct then obviously there will be a successfully computed result.
What you appear to want is a proof checker, and there would be no need to generate any native code or program for that since everything you would care about would be in the proof checker itself.
>How the fuck is that "IO"?
It's a signal just like anything else. How do you think a pixel on the screen is ultimatetly produced? Magic?
>No.
Yes.
>Says who?
It's a logical deduction.
>>
Should I drop programming since I have no feeling of understanding things more complex than "for" and "while" even after four months of programming? I am not able to implement even the simple tasks without looking at stackoverflow or cppreference, it took me almost an hour to implement a sieve which would calculate prime numbers.
I suppose, to struggle like this is not normal?
>>
>>59234643
> I am not able to implement even the simple tasks without looking at stackoverflow or cppreference
So am I and I've been a professional programmer for a decade now.
>>
File: female-programmer.jpg (157KB, 1002x2048px) Image search: [Google]
female-programmer.jpg
157KB, 1002x2048px
>>59233687
be a woman :^)
>>
>>59234694
>tfw actually too intelligent to get a programming job
>>
>>59234706

she never even posted this shit you insolent sperg
>>
>>59234294
>a)
PHP
JavaScript
Python
C
C++

>b)
>This page intentionally left blank
>>
>>59234731
You're moving in the right direction, m8.
>>
>>59234617
>There does not exist a programming language without IO, but you can choose not to use the IO functions.
But does there exist a language which lets me compile programs without IO? Haskell doesn't seem to have this ability.

>>59234627
>How?
If your logic is correct then the computed result is successful.
>What you appear to want is a proof checker
No, I'm not writing any proofs. Can I use a proof checker for writing non-IO programs though? I'll gladly use one if that's the case. Which one should I use?
>It's a signal just like anything else.
You claimed that a emitting a signal is IO, which is obviously untrue.
>Yes.
No?
>It's a logical deduction.
It's an incorrect one.
>>
>>59234769
What the fuck do you mean "compile programs without IO"
You're fucking retarded

And no, you don't need main to write haskell libraries
>>
File: karlie-kloss-code.png (1MB, 1357x1281px) Image search: [Google]
karlie-kloss-code.png
1MB, 1357x1281px
>>59234730
>>
>>59234806
>What the fuck do you mean "compile programs without IO"
I tried compiling a Haskell program with no main and it simply refused.
>You're fucking retarded
Why?
>And no, you don't need main to write haskell libraries
How do I tell the compiler that it's a library?
>>
>>59234809
"she needs to join our startup"
"lets invite her"
kek
>>
>>59234706
Can someone explain what this Q_rsqrt function does?

also:
>OMG this is so trueee why do guys have to make things more complicated for no reason
Bitch please. I'd like to see you write that function to the left in your “non-complicated,” 95% comments way, and see how it'll look; instead of writing a 30-line function for what could have been done in 30 characters.
#define m(a,b) (a)>(b)?(a):(b)
>>
>>59234842
Don't call the module Main
>>
>>59234889
I didn't even use the module syntax, I simply did ghc --make and it refused to compile without main.
>>
>>59233700
Idris already takes care of this for you, and with proofs.
>>
>If your logic is correct then the computed result is successful.
That doesn't help you determine if a particular execution of the program was successful, or if it even ran at all.
>No, I'm not writing any proofs.
See Curry-Howard correspondence.
>Can I use a proof checker for writing non-IO programs though?
A proof checker helps in validating logical statements.
>I'll gladly use one if that's the case. Which one should I use?
Since you wanted something based on sets you could check out Mizar.
>You claimed that a emitting a signal is IO, which is obviously untrue.
No, that is the definition of IO.
Input/output, i.e input and output signals.
>No?
Yes.
>It's an incorrect one.
All programs without IO are equivalent to the no-op or empty program, there would be no reason to execute them or prefer one over the other.
>>
>>59234809

This is getting really old

The fact that /g/ still has a thread about this every other day is pathetic
>>
>>59234901
-no-hs-main
>>
>>59234920
t. karlie kloss
>>
>>59234809
>Karlie Kloss Kodes
>KKK
^ Is she aware of this?
>>
>>59234920
>>59234809

It's because this is an all time upvoted post on /r/ProgrammingHumor. People see it there and think "wow this would do well on /g/".

It comes up when you google "programming humor", click the first result, and go to "top upvoted of all time"

Goes to show how cancerous /g/ is
>>
>>59234920
Nothing is better for beta male bonding than a little bit of misogyny.
>>
>>59234963
>She
:^)
>>
File: CLgm1XqVEAAQRzT.jpg:large.jpg (80KB, 1023x682px) Image search: [Google]
CLgm1XqVEAAQRzT.jpg:large.jpg
80KB, 1023x682px
>>59234920
This. Time to grow up and accept women, /dpt/.
>>
>>59235006
>isis
>>
>>59235006
>helps buidl software sucking CEOs dick
>>
>>59235006
>I help build
>not "I build"
So she's an HR girl?
>>
File: 1466080599364.png (21KB, 3700x3700px) Image search: [Google]
1466080599364.png
21KB, 3700x3700px
>>59234995
Are you implying (s)he's a transgender (wo)man or are you one of those SJWs who demand to be called certain pronouns?
Or do you still think that there are no women on teh interwebz?
>>
>>59234915
>That doesn't help you determine if a particular execution of the program was successful,
I can make a pretty good guess.
>or if it even ran at all.
That's pretty easy to determine by the amount of resources it used.
>See Curry-Howard correspondence.
I'm aware of it. Don't be pedantic, you know what I mean when I say "I'm not writing any proofs".
>A proof checker helps in validating logical statements.
Can I use them as a general purpose programming tool?
>Mizar.
Can it be used fully without IO?

>No, that is the definition of IO
IO as related to programming. A computer emitting a signal wouldn't somehow make any program it runs into an IO program.
>Yes.
No.
>All programs without IO are equivalent to the no-op or empty program
This is plain wrong. They use more resources, which is already different.
>there would be no reason to execute them or prefer one over the other.
I obviously prefer one over the other.

>>59234922
It doesn't seem to work.
>>
>>59235006
>>59235022
kek
>>
File: 1482610796690.png (230KB, 640x360px) Image search: [Google]
1482610796690.png
230KB, 640x360px
>using C++
ISHYGDDT
>>
>>59235006
>ENTRPrISE SOFtWARE
REEEEEEEEEEEEE
>>
File: what_time_is_it.jpg (215KB, 441x594px) Image search: [Google]
what_time_is_it.jpg
215KB, 441x594px
>>59234977
Nothing wrong with that
>>
>>59235051
>It doesn't seem to work.
have you done something wrong? are you using -c or whatever to compile C code?
>>
>>59235086
ghc -c noIO.hs -no-hs-main
Also tried it with -o
>>
>>59235006
she is cute I hope she has a dick
>>
>>59235123
pretty sure you need to link it with something like C that actually does have a main (outside of haskell)

you can't compile to dll, and you can't have a program without main
>>
>>59235051
>I can make a pretty good guess.
On what basis?
>That's pretty easy to determine by the amount of resources it used.
That would require IO.
>you know what I mean when I say "I'm not writing any proofs".
I don't actually since you do seem to imply you're inly interested in logical correctness checking.
>Can I use them as a general purpose programming tool?
General purpose implies IO.
What do you actually want to do?
>Can it be used fully without IO?
You use it to validate proofs (or type checking if you will)
>IO as related to programming.
As it relates to a physical phenomenon.
>A computer emitting a signal wouldn't somehow make any program it runs into an IO program.
Of course it would.
>No.
Yes.
>This is plain wrong.
Nope. There's no experiment you can design to distinguish them
>They use more resources
You can't tell how much resources a program uses without that program performing an IO call to the OS.
>I obviously prefer one over the other.
Why?
>>
File: kodewithkarlie.png (29KB, 960x540px) Image search: [Google]
kodewithkarlie.png
29KB, 960x540px
>>59234809
>>
>>59235155
That defeats the whole purpose. C will still have a main function.

>>59235171
>On what basis?
On the basis of my logic being correct.
>That would require IO.
Yes, which I'm not opposed to using as long as it's outside of my program. Or are you really claiming that I need to do IO in my program to check its resource usage via an external tool?
>General purpose implies IO.
Not really.
>What do you actually want to do?
Just some programming with sets as the basic data structure.
>You use it to validate proofs
I understand, but can I use it without IO?

>As it relates to a physical phenomenon.
Why would that be relevant to the conversation?
>Of course it would.
So you are claiming that there exists no program which doesn't perform IO? It seems pretty retarded to me that anyone would even consider this.
>Yes.
No.
>There's no experiment you can design to distinguish them
I can see the resource usage, which already means the program did something.
>You can't tell how much resources a program uses without that program performing an IO call to the OS.
I can use an external program which measures the resource usage of other programs. I don't need to write a single function in the IO monad to achieve this.
>Why?
Why wouldn't I?
>>
File: 1471969465915.jpg (293KB, 800x757px) Image search: [Google]
1471969465915.jpg
293KB, 800x757px
/dpt/, what's the best intoducotry book on computer graphics?
>>
How do I implement tab-completion in my C programs?
>>
>>59235258
>That defeats the whole purpose. C will still have a main function.
You can't have a program that doesn't have an entry point you fucking idiot.
You are completely retarded.

If you don't want the program to do any IO then just do
main = pure ()
or just load the file in GHCI
>>
>>59234809
Antioxidant Infusions is unironically the most triggering part of that photo.
>>
So, what project should I start and put on my github so I can link it to potential employers?
What projects are they looking for?
And also, should I learn fucking HTML/CSS to make a .io github page to present all my projects?
>>
>>59235284
any projects it doesn't matter what matters is how well you can sell yourself to employers
>>
>>59235263
gnu readline
>>
>>59235284
>So, what project should I start and put on my github so I can link it to potential employers?
>What projects are they looking for?

You just lost our job asking this here. go to hackernews.
>And also, should I learn fucking HTML/CSS to make a .io github page to present all my projects?
Static website generator
>>
>>59235293
But that's GPL.

If it were LGPL I'd be using it.
>>
>>59235300
>you just lost your job
>implying I'm employed

>Static website generator
Will look into that

>>59235284
Well I don't have any projects to present to them, most of the shit I coded in the past is either lost in a hard drive somewhere or unfinished
>>
I need to do a web app with a large (GB) database entirely front-end/static. Am I going to need to make some stupid custom solution involving splitting the database between thousands of files or is this already some framework for this? Google finds nothing.
>>
>>59235331
fug, second answer was mean to >>59235292
>>
>>59235274
>You can't have a program that doesn't have an entry point you fucking idiot.
I'm fine with it as long as the entry point doesn't perform any IO in my program.
>main = pure ()
Main will still have the type IO (). I don't want any IO in my program.
>or just load the file in GHCI
I need to generate native code though.
>>
>>59235262
Lisp.
>>59235263
Lisp.
>>59235284
Lisp.
>>59235343
Lisp.
>>
>>59235331
>>you just lost your job
>>implying I'm employed
jesus you're a fucking retard
>>
>>59235352
YOU ARE SO FUCKING STUPID
YOU DON'T KNOW WHAT YOU'RE TALKING ABOUT
FUCK OFF
>>
>>59235284
>What projects are they looking for?
Depends on the employer.

This one time during an interview the guy asked me if I've heard of a particular program they've been using and I was happy to tell him I'm its developer. Best feeling in the world tbqh.

Still didn't get the job though that was due to HR issues.
>>
>>59235378
>This one time during an interview the guy asked me if I've heard of a particular program they've been using and I was happy to tell him I'm its developer. Best feeling in the world tbqh.
What the fuck
>>
File: 1459087650162.gif (747KB, 500x508px) Image search: [Google]
1459087650162.gif
747KB, 500x508px
>>59235368
I just want a program with no IO. Is that really so hard to achieve?
>>
>>59235405
Not a fucking program you tarp, hang yourself

main :: Monad m => m ()
main = pure ()

>no IO
>>
>>59235378
>HR issues.
elaborate

quotas?
>>
>>59233370
any good alternatives to mathematica, maxima, sage?
>>
>>59235258
>On the basis of my logic being correct.
So just be satisfied with that.
No reason to have any program being generated, it's completetly superfluous.
>Or are you really claiming that I need to do IO in my program to check its resource usage via an external tool?
Your program can't even acquire any resources with IO.
>Not really.
Yes really.
Or do you not know the meaning if 'general'?
>Just some programming with sets as the basic data structure.
Program what?
>I understand, but can I use it without IO?
There is no IO at all, not even any code or program generated, it just checks the logical statements you've written down.
>Why would that be relevant to the conversation?
It's what IO is about.
>So you are claiming that there exists no program which doesn't perform IO?
No, how the hell did you get that from what I said?
>No.
Yes.
>I can see the resource usage
They would all use the same resources (0).
But even so, resource usage would tell you nothing anyway.
>I can use an external program which measures the resource usage of other programs.
A program has to request resources to be able to use them.
>Why wouldn't I?
Because you couldn't tell the difference between a program full of nops and arbitrary memory/fds/etc acquisitions and your program.
So you might as well run that program, or not run it at all.
>>
>>59235331
any small projects will do your technical skills don't even matter that much what matters the most is your social skills and communication skills.

I have seen time and time again the worse persons in software development just because they are Chads
>>
Should I learn Rust, Haskell, or Idris?
>>
>>59235464
Haskell will make learning either of the other two very easy
>>
>>59233370
>What are you working on, /g/?
All small things are cute

I fun it myself
>>
>>59235464
Rust is the most practical, Idris is the least practical, and Haskell is somewhere in the middle. Then again, practicality isn't that important if you're doing it for fun.
>>
File: 040317-1634.png (571KB, 4000x2560px) Image search: [Google]
040317-1634.png
571KB, 4000x2560px
Reverse engineering this software, trying to make a keygen for it.

I wonder how the people in the scene used to make keygens as they would often get stuff released within days, it's so cumbersome to hunt through the binary finding encryption and obfuscation routines to generate valid serials, and then replaying those algorithms it in your own binary is no easy task.
>>
>>59235391
The company was developing and offering some data analysis services to other companies. Basically a glorified SaaS wrapper around existing software, most of it free academic/scientific software. Wrangling that shit to a useful shape to paying customers rather than just academics is usually a hell of a job.

Anyway parts of their pipeline was stuff I developed in grad school kek.

>>59235429
Nah I didn't fulfil some asinine HR formal requirements for the pay grade the job was advertised for. They offered me a contract at the highest level of a lower grade instead, but that was about the same as I was earning at the time anyway and could mean a harder route to promotion.

The mess was mostly because it was an existing company branching into the sector and bringing stupid HR practices over.
>>
>>59235518
>Nah I didn't fulfil some asinine HR formal requirements for the pay grade the job was advertised for. They offered me a contract at the highest level of a lower grade instead, but that was about the same as I was earning at the time anyway and could mean a harder route to promotion.
>The mess was mostly because it was an existing company branching into the sector and bringing stupid HR practices over.
Why do companies do this shit? All it does is piss off productive people.

At least in sectors like finance pay is related to performance, not irrelevant bullshit.
>>
File: isis.jpg (293KB, 1023x682px) Image search: [Google]
isis.jpg
293KB, 1023x682px
>>59235006
>>
File: isishinobi.png (768KB, 804x805px) Image search: [Google]
isishinobi.png
768KB, 804x805px
>>59235022 >>59235027 >>59235036 >>59235056 >>59235073 >>59235136 >>59235549
Please, don't bully

>>59235056
>>59235022
https://en.wikipedia.org/wiki/Isis
>>
>>59235405

Just write a function without return value or input (and don't print anything to the screen) and you should be fine..
>>
>>59235357
Fortran.
>>
>>59235539
The tech people there were angry about it so maybe it was eventually changed. They wanted to hire me but HR cockblocked them.

Probably still a step up from companies who try to leave out tech people out of recruitment entirety and do it fully via HR.
>>
>>59235262
>>59235262
>>59235262
>>59235262
>>
File: 1486924512238.png (260KB, 620x640px) Image search: [Google]
1486924512238.png
260KB, 620x640px
>>59235424
>m ()
What are you hiding from me here? It's IO in this case, isn't it?
>>59235454
>So just be satisfied with that.
I am pretty confident in my abilities.
>No reason to have any program being generated, it's completetly superfluous.
Why do you say so?
>Your program can't even acquire any resources with IO.
Can you not read? I said I don't really care if my OS uses IO to allocate resources for my program.
>Yes really.
Not really though.
>Program what?
Ideally a compiler for my new language.
>There is no IO at all, not even any code or program generated, it just checks the logical statements you've written down.
But I need to generate machine code.
>It's what IO is about.
Not in this case.
>No, how the hell did you get that from what I said?
You said a computer emitting ANY signal would make all programs it runs contain IO. Which is a pretty retarded statement to make and I'm sure you agree.
>Yes.
No.
>They would all use the same resources (0).
Not really though. If I were to write it in Haskell it would automatically allocate and free the resources for me. Making it a non-zero value.
>A program has to request resources to be able to use them.
Which will be handled by the language I'm using. My program doesn't have to contain a single function in the IO monad for this to happen.
>Because you couldn't tell the difference between a program full of nops and arbitrary memory/fds/etc acquisitions and your program.
I could approximate it though, which I'm fine with.
>So you might as well run that program, or not run it at all.
Running and not running it are two completely different things. You have to be a lunatic to claim that the semantics of a non-IO program and the semantics of a never-executed program are the same. For this to be the case no program can possibly have meaning until executed, which is obviously false.
>>
>>59235591
HR is a mistake
>>
>>59233838
All about coding style. Haskell (like C: check out id software's source repos) can be written absolutely cleanly, comprehensibly, prettily --- but like in most other languages, most coders and code-bases avoid doing so and keep the noise-vs-signal ratio at the worst level. Trouble is, clean simple code takes more time to write, "just" to later save time on reading --- a luxury to any project with a deadline
>>
Stop responding to that one guy.
>>
>>59235518
Still, how would it have worked out with the software if you had been hired? Wouldn't that have been an issue, legally speaking.
>>
>>59235606
Are you using the Free monad with Coyoneda and an ADT that describes IO actions?
>>
>>59235263
libedit, readline is deprecated.
>>
>>59235634
Um... Not that I know of.
>>
>>59235262
>>59235262
>>59235262
>>59235262
>>59235262
>>
>>59235442
Not really. There are like 10 people who develop CAS in the world at any given point in time.
>>
>>59235626
I don't think so, they weren't actually distributing any software. Like I said, it was a SaaS thing. Plus I wasn't actively maintaining the stuff of mine they've been using, it's possible they had some in-house fork or whatever.
>>
>>59235464
F# if you want something useful, Haskell if you really want one of the meme languages.
>>
What the kek?
Some posts got deleted.
>>
Suppose I have a project and I want it to:

>build on linux
>build on windows
>cross-compile to windows on linux

Suppose further that the project needs to build binaries that are then used to generate other parts of the projects, e.g. one module is a compiler that is then run over some resource file, which is then included in another binary. Note that this means that when cross-compiling to Windows on Linux, these binaries should be built to be runnable on Linux.

What languages/build systems, if any, support this use case well? AIUI the only way to make this work in the cross-compiling case in CMake is to have two separate builds, one for Linux and one cross-compiling to Windows, and the latter uses the binaries built by the former.
>>
>>59235685
>F#
Absolute shit.
>Haskell
Trash.
>>
>>59235685
F# has a type system that is too limited for my tastes.

Rust's type system is also very limited, but the payoff is no GC.
>>
>>59235694
Most of the retarded ones still seem up though.

>>59235698
Clang has awesome native re-targeting tools, you can do anything for any platform up to LLVM bytecode. Install LLD with it.
>>
>>59235262
>>59235262
>>59235262
>>59235262
>>59235262
ANSWER ME
>>
>>59235740
Post a good and cute anime image and I will consider it.
>>
>>59235672
*Also it was MIT license
>>
>>59235737
Not really what I'm looking for, I want a build system that will automatically do the correct compilation steps, not a compiler.
>>
>>59235606
>Why do you say so?
Because it's useless to run a program without IO.
>Can you not read? I said I don't really care if my OS uses IO to allocate resources for my program.
The OS doesn't randomly dole out resources to programs, it's the programs that must first request them via system calls.
>Not really though.
Except it is.
>Ideally a compiler for my new language.
A compiler without output would be pretty useless.
>But I need to generate machine code.
Why?
>It's what IO is about.
>Not in this case.
It's always the case.
>You said a computer emitting ANY signal would make all programs it runs contain IO.
Not what I said.
>No.
Yes.
>If I were to write it in Haskell it would automatically allocate and free the resources for me.
Only possible with IO though.
>My program doesn't have to contain a single function in the IO monad for this to happen.
IO monad isn't the only form of IO.
>I could approximate it though, which I'm fine with.
No you couldn't.
I can trivially construct a program with different machine code but which uses the exact same resources as your program.
So how would you tell them apart?
>Running and not running it are two completely different things.
Without IO there's no practical difference.
>You have to be a lunatic to claim that the semantics of a non-IO program and the semantics of a never-executed program are the same.
They are the same though.
>For this to be the case no program can possibly have meaning until executed, which is obviously false.
Nope, that is actually true.
>>
New thread:

>>59235789
>>59235789
>>59235789
>>
>>59235740
Michael Abrash's Graphics Programming Black Book
>>
File: 1488596030334.jpg (157KB, 1070x1070px) Image search: [Google]
1488596030334.jpg
157KB, 1070x1070px
>>59235746
>>59235740
here you go, you monster.

>>59235798
I don't have that much money
>>
>>59235822
>I don't have that much money
that's why torrents exist
>>
>>59234548
One approach: whip up your own little http/json/whatever API endpoint that looks up and caches weathers using your token/username. Have your end-user app contact this instead of the 3rd-party weather API. Also allows changing the 3rd-party (more) easily without breaking/having-to-update clients.

Another: ask for an "app" token/key for your free app. Gnome uses OpenWeatherMap without me needing to sign up there.
>>
>>59235842
I want a physical book.
>>
>>59235788
>Because it's useless to run a program without IO.
According to you. Why do you think I care about that?
>The OS doesn't randomly dole out resources to programs, it's the programs that must first request them via system calls.
Which I'm okay with.
>Except it is.
Except it isn't.
>A compiler without output would be pretty useless.
According to you. It would be pretty useful to me.
>Why?
To make it efficient.
>It's always the case.
It isn't, did you not read my post?
>Not what I said.
Sounded a lot like it.
>Yes.
No.
>Only possible with IO though.
Do you on purpose ignore parts where I say that I don't care about external IO?
>IO monad isn't the only form of IO.
It is in Haskell as far as I know.
>No you couldn't.
I personally can. I have an algorithm for doing so.
>So how would you tell them apart?
I wouldn't be able to, nor do I need to. I won't be running fake programs made by other people to make fun of me.
>Without IO there's no practical difference.
This is blatantly false.
>They are the same though.
I see, so if you write the denotational semantics (semantics are by definition concerned with meaning) of a program on paper it's actually meaningless?
>Nope, that is actually true.
Only a complete retard could believe this.
>>
File: isis_god_art.jpg (193KB, 534x643px) Image search: [Google]
isis_god_art.jpg
193KB, 534x643px
>>59235006
isnt isis some egyptian feminine goddess or some shit
>pic related
>>
>>59234459
Hey script kiddo, ever heard of the difference between compile-time errors (the case you quoted) and runtime panics (easily, provably avoidable in a Haskell codebase)?

That was just a case of bad compiler error *message* there. A better one would have been "fact is not defined anywhere" as that was the very mistake the coder above made.

Now get back to writing "tests" for your scripts.....
>>
>>59235920
It is. It's also an underwear brand in The Netherlands.
>>
>>59235932
"provably avoidable" == except for that pesky halting problem of course
>>
>>59235902
>According to you.
According to everyone.
>Which I'm okay with.
Then all your program will use 0 resources since there's ni way to request resources without IO.
>Except it isn't.
It is.
>According to you. It would be pretty useful to me.
According to everyone.
I also forgot about the I in IO - you couldn't feed your compiler any data either. So what are you compiling? The same static data every time?
>To make it efficient.
Just reduce and dead code eliminate every program to a single 'ret' instruction since that is what all non-IO programs can be optimized to.
>It isn't, did you not read my post?
I did and you haven't convinced me otherwise.
>Sounded a lot like it.
Then you misread or misunderstood.
>No.
Yes.
>Do you on purpose ignore parts where I say that I don't care about external IO?
I'm talking about internal IO - the actual program must do the request, not some external one.
>It is in Haskell as far as I know.
We aren't talking about haskell.
>I personally can. I have an algorithm for doing so.
Show it.
>I wouldn't be able to, nor do I need to.
And that's what I've been telling you!
Skip the program/code generation part all together, just focus on proof checking.
>This is blatantly false.
Nope.
>I see, so if you write the denotational semantics (semantics are by definition concerned with meaning) of a program on paper it's actually meaningless?
Indeed.
Just do pure mathematics if that is what you're interested in.
>>
>>59234643
>Should I drop programming since I have no feeling of understanding things more complex than "for" and "while" even after four months of programming? I am not able to implement even the simple tasks without looking at stackoverflow or cppreference, it took me almost an hour to implement a sieve which would calculate prime numbers.
>I suppose, to struggle like this is not normal?
You have really trained yourself to look up solutions, not devise them from the ground up. You assess correctly that skills-wise this is suboptimal. The only way to improve the situation is to force yourself to pretend the internet went down (just keep your language reference of keywords/standard libs handy offline, eg. using Zeal docs or some such) and teach yourself to come up with a solution, always iterating as follows:

1. a solution that compiles but may be buggy
2. a solution that seems correct but may be slow or more convoluted/unelegant than it should be
3. the best solution you can muster after having attacked the above 2
4. then you compare with online approaches if you still have the patience
5. periodically quickly-scan-review the day's code written, ie while pushing to github or so where you see only your latest diffs --- you'll notice obvious little things you didn't think of while you were engrossed in those bits
6. make all of these habits for months on end

It's slow going and feels less productive, but in the long run nothing feels as productive as full robust proficiency. At least I keep telling myself that, while the node.js kiddos pump out fancy app after fancy app.
>>
>>59236104
>According to everyone.
Everyone by definition includes me. According to me it isn't useless. Therefore you are incorrect.
>Then all your program will use 0 resources since there's ni way to request resources without IO.
From now on I won't respond to this type of sentence if you continue ignoring the fact that I do not care about what kind of IO is done by the haskell runtime to achieve the needs of me allocating and freeing resources.
>It is.
Wrong.
>According to everyone.
Read my first sentence.
>So what are you compiling? The same static data every time?
Correct.
>Just reduce and dead code eliminate every program to a single 'ret' instruction since that is what all non-IO programs can be optimized to.
But it isn't dead code.
>I did and you haven't convinced me otherwise.
Seems like you didn't.
>Then you misread or misunderstood.
In what way?
>Yes.
No.
>I'm talking about internal IO - the actual program must do the request, not some external one.
Nothing in my program itself explicitly does any IO. I don't care what Haskell itself does to my program to make it run.
>We aren't talking about haskell.
I am.
>Show it.
Why would I be showing it off to people who don't understand basic things such as "a non-running program and just a non-IO program have different semantics"?
>Skip the program/code generation part all together, just focus on proof checking.
Why would I be doing that when I need to run actual code?
>Nope.
Yes. Any non-retard can see that.
>Indeed.
You have just proven yourself to be utterly retarded. 2 + 2 is semantically the same as not running a program, great logic.
>Just do pure mathematics if that is what you're interested in.
Pure mathematics doesn't really have a concept of something being compiled.
>>
>>59235343
Entirely front-end / static? Does the data change occasionally, never, or frequently?

Not that I'd know the actual answer to your question (as in "readymade frameworks")
>>
>>59235405
Impossible even. Face it. Unless you show otherwise. Sounds like you just want to make the computer do calculations without ever collecting the results. If you can't do it (in principle) in Assembly, you can't do it in any higher language. Now how the hell was that NOT self-evident to you from the outset, troll?
>>
>>59236228
>According to me it isn't useless.
You are actually wrong about your own opinion, probably because you don't realize the implications of what you're saying.
>From now on I won't respond to this type of sentence if you continue ignoring the fact that I do not care about what kind of IO is done by the haskell runtime to achieve the needs of me allocating and freeing resources.
The Haskell runtime is not any different from the OS with respect to a C program making system call requests to allocate memory - they both need to initiate the request in the program code.
>Wrong.
Nope.
>Correct.
A useless compiler in other words.
The two fundamental operations of a compiler is reading input in a source language and producing output in the target language, without those two it's arguable not even a compiler at all.
And another pretty important function is producing diagnostics, i.e error messages.
You would be hard pressed to find anyone thinking a 'compiler' running a translation on the same static input, never producing any output to be if any use.
>But it isn't dead code.
It's pretty much the definition of dead code.
>In what way?
That I didn't say that.
>No.
Yes.
>Nothing in my program itself explicitly does any IO.
Then you always get 0 resources.
>I am.
No you aren't. You were asking about a language based in sets and without IO - and that definitetly isn't Haskell.
And I've obviously been talking about the general concept if IO - not tied to any particular language.
>Why would I be showing it off to people...
Be showing it and if it makes logical sense you would convince me there is a difference.
>Why would I be doing that when I need to run actual code?
Why do you need to run it?
>Yes.
Prove it.
>2 + 2 is semantically the same as not running a program
Now you're just rambling nonsense.
>Pure mathematics doesn't really have a concept of something being compiled.
Of course it does.
S -> T
or
f(x) = x+1

Compilation is just a mapping from input to output.
>>
>>59235549
Dunno where you're from or she, but in British English "helping/helped/helps/help build X" is entirely correct phrasing.
>>
why there is 3 /dtp/ threads? I don't know which one i should post. Sorry about that. Anyway i need heeelp ;_;

I just write a program thats creates moving rectangles when i press space and it supposed to not remove other moving rectangle when creates and adds new rectangle to the ArrayList.
What do i need? Can somebody test my code and say what is wrong?

package ArrayLists;
//imports here (comment section say its too long to post)

public class test extends JPanel implements ActionListener,KeyListener{

private ArrayList<Rectangle> rec_list;
Iterator<Rectangle> rec_iterator;
private Rectangle test_rec;
private int rnd_1,rec_y = 0;
private Timer timer1;
private Random rnd = new Random();
public test(){
rec_list = new ArrayList<Rectangle>();
timer1 = new Timer(10,this);
timer1.start();
}

public void add_rec(){
rnd_1 = rnd.nextInt(400)+10;
rec_y = 0;
test_rec = new Rectangle(rnd_1,0,25,25);
rec_list.add(test_rec);
}

public void actionPerformed(ActionEvent event) {
rec_y++;
repaint();
}

public void paintComponent(Graphics g){
super.paintComponent(g);
rec_iterator = rec_list.iterator();
while(rec_iterator.hasNext()){
test_rec = rec_iterator.next();
g.fillRect((int)test_rec.getX(), (int)test_rec.getY(),
(int)test_rec.getWidth(), (int)test_rec.getHeight());
test_rec.setLocation(rnd_1,rec_y);
}
}

public void keyPressed(KeyEvent key) {
int k = key.getKeyCode();
if(k == KeyEvent.VK_SPACE){
add_rec();
}
}

public void keyReleased(KeyEvent arg0) {
}
public void keyTyped(KeyEvent arg0) {
}

public static void main(String args[]){
JFrame frame = new JFrame("Title");
test t = new test();
frame.add(t);
frame.addKeyListener(t);
frame.setSize(500, 500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
>>
>>59236605
>what is wrong
everything
>>
>>59236424
It is possible. Write 'let f x = x + x' in ghci. It's program with no IO.
>>59236492
>You are actually wrong about your own opinion
It doesn't matter.
>Nope.
Yup.
>A useless compiler in other words.
According to you, but you have already proven yourself to be retarded so that's fine by me.
>And another pretty important function is producing diagnostics, i.e error messages.
You don't need error messages if you aren't stupid.
>You would be hard pressed to find anyone thinking a 'compiler' running a translation on the same static input, never producing any output to be if any use.
It has use. To me. I'm not planning on you using it anyway.
>It's pretty much the definition of dead code.
Wrong.
>That I didn't say that.
Incorrect.
>Yes.
No.
>Then you always get 0 resources.
This is false and you know it. Stop lying.
>No you aren't.
I am. Haskell has sets and it can be used without IO.
>And I've obviously been talking about the general concept if IO - not tied to any particular language.
So you've been talking to yourself?
>Be showing it and if it makes logical sense you would convince me there is a difference.
I won't show something to a moron who thinks that a program with no IO and a non-running program are the same. It's in my moral code never to do such a thing.
>Why do you need to run it?
To make it compute something.
>Prove it.
I did. Too bad you can't read.
>Now you're just rambling nonsense.
Oh, it seems like you're becoming self-aware. That was almost a direct quote.
>Of course it does.
Now run it without IO.
>>
>>59236645
tell me please.
>>
>>59236683
pay me 1 billion dollars
>>
File: Young_Judy_Hopps.jpg (565KB, 1920x804px) Image search: [Google]
Young_Judy_Hopps.jpg
565KB, 1920x804px
>>59236708
i don't have any ;_;
>>
>>59236370
Never. It's a dictionary.
>>
>>59236656
>It is possible. Write 'let f x = x + x' in ghci. It's program with no IO.
There is only one program with no IO. It's ().
>>
>>59236889
Wrong. What you quoted contains a valid program with no IO.
>>
>>59236921
It's not a program, there is no main. It's a apart of a program.
>>
>>59236940
A program doesn't need a main.
>>
>>59236974
>A program doesn't need a main.
A program is a main.
>>
>>59236991
Wrong.
>>
>>59237039
Wrong.
>>
File: 457edd24cde85b152411e7f93d32f699.png (851KB, 752x1211px) Image search: [Google]
457edd24cde85b152411e7f93d32f699.png
851KB, 752x1211px
Parsing HTML with regex
#!/usr/bin/env python3

# ./wiktionary.py https://en.wiktionary.org/wiki/Appendix:JLPT/N5 > n5.flash

import urllib.request
import re
import sys

url = sys.argv[1]
res = urllib.request.urlopen(url)
body = res.read().decode('utf-8')
for line in body.splitlines():
line = line.strip()
ja = re.findall('title="(\S+)"', line)
en = re.search(' -(.+)</li>', line)
if ja and en:
sys.stdout.write(', '.join(ja))
sys.stdout.write('|')
sys.stdout.write(en.group(1))
sys.stdout.write('\n')
>>
File: 1361090276889.png (48KB, 1024x683px) Image search: [Google]
1361090276889.png
48KB, 1024x683px
What is a monad?
Thread posts: 345
Thread images: 36


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.