[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 33
File: ew.png (389 KB, 934x1000) Image search: [Google]
ew.png
389 KB, 934x1000
What are you working on, /g/?

Old: >>52172915
>>
TOO EARLY TRAP HATER
>>
File: merryXmas.jpg (128 KB, 1067x535) Image search: [Google]
merryXmas.jpg
128 KB, 1067x535
Post your cheeky one-liners you pieces of shit

i'll fite you
>>
>>52175128
TOO
EARLY
>>
Don't ever fucking reply to me again unless you're contributing to the thread.
>>
>>52175128
>new thread in 297 posts when the new bump limit is at 310
>>
>>52175144
>>52175160
>>52175174
A U T I S M
U
T
I
S
M
>>
>>52175144
>>52175160
I forgot the bump limit is 310 now, we're not that far away.

My mistake senpai. No need to be autistic.
>>
>>52175183
Even then, you did remember that the bump limit is at 300 posts and you made the new thread before that.
You are a cancer
>>
File: de.gif (184 KB, 300x169) Image search: [Google]
de.gif
184 KB, 300x169
So what are you working on, /g/?
>>
File: mems.jpg (179 KB, 999x513) Image search: [Google]
mems.jpg
179 KB, 999x513
>>52175158
>>
Daily reminder that if your language of choice is not on this list you should probably give up and kill yourself:
- C++
- C#
- Lua
- Python
- Elixir
- Haskell
- Bash
- Clojure
- D
>>
Remind that 'perfect circles' and 'infinity' are as real as unicorns and that abstract math is a Jew lie.
>>
>>52175264
Everything in there is a fucking cancer except Haskell which is a meme.

>Lua
>Bash
Okay, it's a troll
>>
>>52175264
Add Go.
>>
File: mems.jpg (116 KB, 593x505) Image search: [Google]
mems.jpg
116 KB, 593x505
tripfags gonna love this
>>
>>52175303
>black-and-mixed-girl-appreciation
>>
>>52175281
Reminder that "infinite countable sets" and "uncountable sets" are as real as unicorns and that abstract math is a Jew lie.
>>
>>52175303
>he doesn't download multiple images in parallel
>>
>>52175259
def m(w,n):
print "\n".join(["".join([w[(i+j)%len(w)] for i in range(n)]) for j in range(n)])

m("MEME SQUARE",50)
>>
File: sicplolicon.jpg (142 KB, 669x900) Image search: [Google]
sicplolicon.jpg
142 KB, 669x900
Have you read your SICP today ?
>>
Is C the biggest meme? My retarded friend just started learning from K&R and he won't shut up about it. I already know Haskell and tried to steer him right but he insisted on learning C because of "muh games". Fuck.

How can we fix this?
>>
>>52175295
>Everything in there is a fucking cancer except Haskell which is a meme.
Explain?
>>
>>52175321
good idea lad, I've never worked with threads, but would this be a sound idea
1st thread collates json info on a board once per second
2nd thread starts downloading at the same time
1st thread joins in after getting all json info

This way I don't violate 4chan's once a second json guideline
>>
>>52175346
 goto reddit; 
>>
>>52175325
ftfy
m = lambda w, n: print("\n".join("".join(w[(i+j)%len(w)] for i in range(n)) for j in range(n)))
>>
>>52175325
I realize the list was useless too, fuck me it's long
>>
>>52175343
>my dick is made out of diamonds
>>
File: 1418947387231.jpg (55 KB, 559x372) Image search: [Google]
1418947387231.jpg
55 KB, 559x372
dealing with fucking binary registers in C on an AVR with no debugging or feedback except 4 LEDs on the I/o ports
>>
>>52175357
>wahhhhh he doesn't my toy language i guess i should send him to reddit
>>
>>52175281
What about negative numbers? Are they an abstract concept?
>>
>>52175392
Time to get good. Add a seven segment.
>>
>>52175346
>implying there's anything wrong with learning C
Stop being autist, if anything encourage him to also learn a higher level language like C++ or D
>>
>>52175347
Everything in the list in the post I quoted except Haskell is a cancer.
Haskell is not a cancer but it is a meme.
Clear enough?
>>
>>52175343
reported
>>
>>52175346
>C
>Games
lmfao
>>
>>52175440
Why? It's a fully dressed little girl?
>>
>>52175440
It's just a kid. She's not even in a lewd position.

What's the problem?
>>
>>52175346
Kill yourself

>>52175422
Stick a poop up your butt and then kill yourself
>>
>>52175441
I know right? I tried to tell him that if he actually wanted to be productive, learn Python and use pygame, but he wants to do 3D shit I guess? C is such a dumb fucking meme and the autists on /dpt/ aren't helping.
>>
>>52175434
Why is Haskell a meme?
>>
>>52175264
Great
>- Python
>- Elixir
>- Haskell
>- Clojure

Perfectly fine
>- C++
>- Lua
>- D

Bad
>- C#
>- Bash
>>
>>52175503
100% agreed
>>
>>52175473
If he wants to do 3D he's probably better off using an existing engine if he just started with programming, he's not gonna make his own in at least the next decade.
>>
>>52175503
Masterpiece
>-Go
>-C
>>
>>52175503
this
>>52175522
>>
File: ew.png (272 KB, 470x624) Image search: [Google]
ew.png
272 KB, 470x624
>>52175264
Have I be learning JavaScript for the past few days for nothing? I was having fun with it too.

I
>>
>>52175503
>Python
>Elixir
>Clojure
Shit

>C++
>Lua
>D
Shit

>>52175522
>>52175574
Niggers

>>52175575
>trusting random trolls on 4chan
Javascript is shit, but language is the last thing that matters
Go for it if you liked it.
>>
>>52175343
she's so cute
>>
File: uui9.png (481 KB, 626x988) Image search: [Google]
uui9.png
481 KB, 626x988
>>52175601
>Go for it if you liked it.
Thanks, anon. It just magically works, I don't even have to download anything. JavaScript is great.
>>
>>52175343
This is gimped, she is not actually holding a SICP.
I hate you anon.

>sicplolicon.jpg
You are a pedo
>>
On the subject of C, when are we getting a new version? Surely there are some nice thing planned for after C11? There are quite a few cool things that happened in the C++ space that would fit C well.
>>
>>52175419

To display an 8 bit register in decimal it would take 3 digits - ain't nobody got time for that
>>
>>52175740
Wait 10 or so year.
>>
>>52175740
31 of February 2016.
it's on their website
>>
https://www.reddit.com/r/ProgrammerHumor/comments/3z0mz6/4chan_on_tech_startups/


REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>52175769
Neat, thanks.
>>
>>52175740
c is a dead language. it's used for low level stuffs that don't need "cool things"
>>
whats /g/s problem with C++?
>>
>>52175817
It's slower than C. It's harder to write than Java/C#. There's no use for it.
>>
File: flower of life.jpg (44 KB, 565x233) Image search: [Google]
flower of life.jpg
44 KB, 565x233
>>52174820
you're missing a lot of circles

and don't forget that it should scale to arbitrary input, within reason (practically any number of circles)
>>
>>52175817
It's too difficult for the poor babbies.
>>
File: 8u.jpg (50 KB, 640x360) Image search: [Google]
8u.jpg
50 KB, 640x360
>>52175776
Reminder that we have to be racist every now and then to keep the redditors away.

Lets write some classes for Africans, Asians, and Europeans. It will be fun.
>>
File: 1446101214780.jpg (144 KB, 500x713) Image search: [Google]
1446101214780.jpg
144 KB, 500x713
>>52175817
For me, nothing, it is just that when I have to interface with cross language / legacy stuff I always get C and never C++. C++ is much more avoidable than C.

It is also too big to pick up and keep in your mind if you don't use it to write software in C++.

I never write programs in C but bits of C and bits of interfacing are super simple to do even if you haven't done C in a while.
>>
>>52175877
> It's slower than C.
False.
> It's harder to write than Java/C#.
True, but unless you're a complete scrub, not all that relevant.
> There's no use for it.
False.
>>
>>52175877
Only when you use features that don't exist in C.
It's like saying it takes less time to travel 5 meters than it takes to travel 500 kilometers.
>>
>>52175881
is it tree after fruit? what's after tree?
>>
Based Huntelaar
>>
File: 1400857966432.jpg (40 KB, 500x375) Image search: [Google]
1400857966432.jpg
40 KB, 500x375
>>52175877
>It's slower than C.
>>
I'm trying to make a ping and pong server in python.

ping talks to pong, gets and message and displays it.

pong waits for a connection and accepts it.

in python.
>>
>>52176008
nice duderski!
>>
>>52175915
> Only when you use features that don't exist in C.
In terms of "harder", that's true to an extent. But unless you're writing everything from scratch, you'll end up using those features because any C++ you interact with will use them.

But more generally, programming isn't exactly the ideal career for anyone who runs away from things because they're hard.

In terms of "slower", that's mostly untrue. Even features which have an actual performance cost (e.g. virtual methods) aren't any slower than doing the equivalent in C (e.g. using function pointers).

And a lot of the time, using C++ means that you can have both performance and legibility, whereas C requires that you to choose one or the other.
>>
>>52175817
It's a complex language, when java was beginning its existence there was a concerted PR campaign around how the complexity was toxic and Java was a simpler alternative. Which like, maybe that's fair, but it's not sufficient to dismiss the language entirely.

Anyway, the "C++ is too complicated" thing really stuck, people take it out of context, and think it means the language should never be touched with a 10 foot pole, which is a shame since it has the most powerful metaprogramming system that's made it into a mainstream language since lisp stopped being cool (if it ever was).
>>
>>52176052
Templates are shit desu. If you want real metaprogramming, you'll write your own DSL. I don't really write regular C code anymore, I pass it through my own custom preprocessor which has quite a few features.
>>
>>52175923
they didn't say

apparently there's a lot of spiritual weirdness associated with this symbol

have a look at the first minute of this if you want a clearer visualization of what you're supposed to draw

https://www.youtube.com/watch?v=i-gLp8LJB68
>>
>>52176089
>Jude star
smdh
>>
>>52176034
Thanks, man! :^)

Honestly, it's just a small thing to get me into Python. It's not much different from making a server-client program and making them communicate with each other.
>>
>>52175881
groan

I'll probably get around to fixing it tommorrow then
>>
>>52175208
the new de facto standard is to allow the first thread posted near the bump limit

deal w/ it
>>
>>52176075
>Templates are shit
They have their flaws for sure but they're powerful. Name me one commercially successful language that has a better mechanism for metaprogramming.

DSLs can be fun but they're never reasonably going to match C++ performance and they, by definition, are never going to enter into the mainstream.
>>
>>52176153
>commercially successful language
Only C#, Java and C++ can be called as "commercially successful languages"
>>
>>52176167
By what standard? How is something like Ruby not commercially successful?
>>
>>52176167
and rightfully so. they're literally the best programming languages in existence.
>>
>>52176153
>Name me one commercially successful language that has a better mechanism for metaprogramming.
Lisp, Forth.
>inb4 goalpost moving
>>
>>52176129
will probably just create a list of coords and draw circles there
>>
>>52176225
Python? yes
Javascript? yes
Ruby? no

>>52176300
not commercially successful
and yes, he does move the goalpost
>>
>>52176324
>Python? meme
>Javascript? meme
Ruby? meme

What's your point?
>>
>>52175343
That kid has a derpy face.
>>
>>52176300
>Lisp
My quote:
which is a shame since it has the most powerful metaprogramming system that's made it into a mainstream language since lisp stopped being cool (if it ever was).


>Forth
Based on what? I'm actually asking. What substantive commercial programs are written in Forth and still exist today?
>>
>>52176333
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52176324
>not commercially successful
Define "commercially successful"
Lisp and Forth have been and are being used in commercial projects.
>>
>>52176342
>still exist today
>>
>>52176343
No one is afraid of you. Your sexual interests mirror your physical strength. You're as frightening as a little girl.
>>
>>52176343
i love this meme
>>
>>52176386
Stop replying to yourself.
>>
>>52176403
Never fucking reply to me again unless you're contributing to the thread.
>>
File: ygQUR9Y.webm (739 KB, 720x404) Image search: [Google]
ygQUR9Y.webm
739 KB, 720x404
Ask your much beloved programming literate anything.

>>52175877
>It's slower than C.
Wrong, c++ has more optimization rooms.

>It's harder to write than Java/C#.
Easy to find counter examples (for java).

>There's no use for it.
C++ is now considered to be the most suitable programming language for cross-platform mobile development.

>>52175343
>meme with loli
We oldschool now ?
>>
Daily reminder that we know what you did
>>
Another quality TDPT thread (oh sorry meant /dpt/ since we reddit now)....

Maybe my new years resolution should be stop wasting time on 4chan
>>
>>52176300
any dynamic pl with eval() (python, javascript, lisp, ruby, ...)
>>
>>52176430
>Wrong, c++ has more optimization rooms.
Lol?

Are you one of those retards that uses constexpr instead of #defines? Because that shit's fucking stupid.
>>
>>52176225
becuz nobody gives a fuck about ruby
>>
File: lau.webm (567 KB, 445x247) Image search: [Google]
lau.webm
567 KB, 445x247
>>52176452
sure, do that with the C preprocessor

http://roartindon.blogspot.com/2014/10/compile-time-murmur-hash-in-c.html
>>
>>52176436
m-me?
>>
>>52176473
fuck you
>>
>>52176324
>>52176349
There are a lot of languages far less popular than Lisp which were used in commercial products for more than a decade, but I wouldn't consider them to be commercially successful.
>>
>>52176451
Lisp eval is very different from Python and JavaScript's, and I assume Ruby's as well
>>
>>52176500
Again, every competent C programmer has re-implemented their own C preprocessor which offers greater control.
>>
>>52176452
Not him, but constexpr isn't an optimization, it's just a better paradigm than simple text macros.

C++ has more room for optimization due to language constructs. References over pointers, for example, allow some optimizations due to certain constraints (they aren't nullable for example). Default constructors allow efficient implementations in the standard library, rather having to boilerplate everything yourself.
>>
>>52176075
> If you want real metaprogramming, you'll write your own DSL.
And presumably your own source-level debugger, static analysis tools, code browser, editor support, and so on. Needless to say, you aren't going to be able to hire developers who'll be productive from day one (if you can even get anyone competent to take the job in the first place).

DSLs have their place, but if you're thinking objectively, you don't use them unless the alternatives are absolutely intolerable.

Also: most templates aren't even trying to address the same problems as DSLs, they're just parametric types.
>>
>>52176559
>And presumably your own source-level debugger, static analysis tools, code browser, editor support, and so on.
This desu senpai.
>>
>>52176559
Debugging autogenerated C is much easier than debugging assembly, to be honest. I find logic errors very quickly when I'm writing my DSLs.
>>
File: leavemealone.webm (372 KB, 400x300) Image search: [Google]
leavemealone.webm
372 KB, 400x300
>>52176554
Thank you. There also de-vertualization.
>>
>>52176349
>Define "commercially successful"
Well above I threw out "used in substantive commercial project which are still used today" which I think remains true but OK, that's arbitrary.

The point I was making was that C++ would have been, and briefly was, a good opportunity to get metaprogramming into the mainstream, to get your average joe programmer thinking about it.

Let's put it differently. It's a shame Java's smear campaign on C++ was successful because it's the only programming language which nearly every working programmer would know about and which most would have at least seen a little of. Like most programmers who don't write Java can still read it by osmosis, it's everywhere. Same with C, so it was for a time with C++. The same can not be said for Lisp (today) or Forth (ever).
>>
>>52176500
Needs javascript
>>
>using languages with metaprogramming
>not using languages where it's just programming
>>
>>52176342
>Based on what? I'm actually asking. What substantive commercial programs are written in Forth and still exist today?
Loads of embedded devices.
NASA still uses it on some of their instrumentation controls, GD SATCOM on their antenna systems, many industrial robots and automated machinery run Forth kernels.
VFX Forth and SwiftX are commercial Forth implementations still being sold and maintained today.
>>
>>52176643
I'm not insane, I wouldn't use C++ for stuff I do a lot faster in Python for example. I use C++ when it is appropriate, C when that's appropriate, Python when that's appropriate and so on.
>>
>>52176643
>retards actually think native metaprogramming support is useful when any competent developer will write their own code to generate code to their liking
>>
>>52176643

F# has the best idea for DSLs

let result =
DSL_obj {
// DSL code
}

e.g. built in:
let sequenc = seq { (*seq code*) }
let taskasy = async { (*async code*) }
let linqueer = query { (* LINQ *) }

you can also capture expression trees rather than results

Inline DSL can be really useful senpaitachi
>>
File: mems.jpg (116 KB, 979x513) Image search: [Google]
mems.jpg
116 KB, 979x513
shorter memesquare code
>>
>>52176679
I'm not talking about dynamically/duck typed languages where everything is a table or list or whatever, I'm talking about dependent types

>>52176747
F# didn't invent monads you shill fuck
>>
File: 1205731416868.gif (14 KB, 400x400) Image search: [Google]
1205731416868.gif
14 KB, 400x400
what is a good tutorial for programming in python?

i have an interactive brokers account and it's the only language i can algo trade with it
>>
>>52176612
C++'s meta programming is absolutely dreadful though, it's extremely syntactically noisy to the point of where many interesting meta programming techniques are practically unfeasible, doesn't meld well with the rest of the language (basically becomes a second, different language), and it's really slow (as in compile times). It's so bad that many people who want to do serious meta programming in C++ develop their own tools - and own languages - which then spit out C++ code at the end just to be compiled and never touched by humans.
People introduced to meta programming via C++ is likely to get the wrong idea of what it is.
>>
>>52176679
>muh every language is appropriate for something
fuck off turd
>>
>>52176756
Nobody said it did you autistic sperglord
I said it has the best language for DSLs

They aren't all monads, either, not that you fucking care
>>
>>52176687
I'm not sure what exactly you had in mind when you wrote this but I am sure it's a terrible idea.
>>
>>52176755
LONDON
ONDONL
NDONLO
DONLON
ONLOND
NLONDO
>>
>>52176805
Well, sequence looks like a list comprehension (monad), futures are a monad, and LINQ is a monad

So yeah
>>
>>52176819
Instead of using some retarded indian's implementation of metaprogramming, you write your own C program that reads in a text file and processes it into a .c file. Then you compile that .c file with your compiler.

You can implement whatever features you want.
>>
>>52176831

Literally nothing forces them to obey the laws of monads. They could be regular functions, monoids, continuations, etc.
>>
>>52176802
I didn't say that, nice strawman argument. I actually said the opposite, namely that (some) languages have their specific uses.

>>52176756
>I'm not talking about dynamically/duck typed languages where everything is a table or list or whatever, I'm talking about dependent types
My point was apparently lost on you. I meant that people don't use C++ because of its metaprogramming features (although I'm sure you'll find some weirdo deviants ITT but this is 4chan after all), people use C++ because they need its speed.
>>
File: mems.jpg (46 KB, 900x232) Image search: [Google]
mems.jpg
46 KB, 900x232
>>52176822
>>
>>52176879
C is appropriate for everything these two other languages are appropriate.
>>
>>52176878
Then F# is adding cruft on top of what do-notation ("computation expressions") can already do
>>
>>52176767
>C++'s meta programming is absolutely dreadful though
I've responded to this multiple times already. No, it's not perfect, the point was that it's powerful and in a language that had a real shot at being the lingua franca of its time

>it's extremely syntactically noisy
Perfectly valid complaint, but doesn't change my point

>and it's really slow (as in compile times).
A decent module strategy and this becomes, more or less, a non-problem.
>>
>>52176879
You're the one who started railing off about C++ and Python and whatnot though
>>
>>52176916
You're so desperate to prove that F# is shit
>>
>>52176845
Hey, look at that, I was right. You really were thinking of something stupid.
>>
File: 1451551029327.png (402 KB, 1024x768) Image search: [Google]
1451551029327.png
402 KB, 1024x768
Are people talking negatively about python again?
>>
based apple or not?

https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md
>>
>>52176963
How is it stupid? It's literally extending the language you use and making it better, instead of relying on flawed one-size-fits-all solutions designed by committees.
>>
>>52176980
>thought it's a list of ideas they will implement
>thought it was pretty good
>read top
>it's the opposite
what a shitty company
>>
>>52176958
Yeah, well, it is a pretty shit language and it's annoying as fuck when you shill it so hard

It's OCaml bastardized into working with .Net, losing its great features like functors and row polymorphism, and it's full of brand-name features that are just convoluted versions of what functional programmers are all already familiar with

It may be the best out of the .Net ecosystem but that's not an accomplishment
>>
>>52176915
C has a god awful development time, and if you use C for doing simple scripting such as web crawling or batch processing of files or regex searching in files or simple data processing (aka matplotlib + numpy), then you are doing things horribly inefficient.

>>52176952
Have I angered you somehow? You don't even have a point, you're just basically ranting and name-calling at this point. What's your point?
>>
>>52176980
Everything seems pretty reasonable.
>>
>>52175913
>True, but unless you're a complete scrub, not all that relevant.
Are you retarded?
Harder to write also means harder to read (and c++ is easily one of the most nonreadable nonesoteric languages around)
>>
>>52177034
My point is that having to do "metaprogramming" in some different, higher level syntactic layer is a deficiency of the language
>>
>>52177034
maybe if you suck at it
>>
>>52177022
>wanting python indentation
>wanting words instead of symbols for logical operators
>wanting 99% of what's on that list

please kill yourself in real life
>>
>>52175750
do it in hex
>>
>>52176980
>Rewrite the Swift compiler in Swift: This would be a lot of fun someday, but (unless you include rewriting all of LLVM) requires the ability to import C++ APIs into Swift. Additionally, there are lots of higher priority ways to make Swift better.
Do they not know that LLVM has a C API?
>>
>>52177031

I literally just said "F# does inline DSL the best" when we were talking about using fucking inline DSL and metaprogramming. What's your problem?

>it's a pretty shit language
Then most languages are shit and you have high fucking standards.
>>
>>52177093
>not wanting python indentation for focus on clarity and conciseness while removing needless, disgusting braces everywhere
>>
>>52177124
My problem is that you're annoying as fuck

>Then most languages are shit and you have high fucking standards.
You're absolutely right
>>
>>52177055
Are you actually saying that you select the language you work with solely based on its programming paradigm?

I mean, sure you can probably do a lot of general purpose programming in these, but in the real world we actually have to deal with legacy code, other team members, implementation tools, third-party tools and frameworks etc.

Sure, from a computer science point of view it's fun to discuss the upsides and downsides to certain programming paradigms and weaknesses and flaws in certain languages' implementations of these, but from a practical point of view it's just meaningless snobbery.

As I said, no sane person would select C++ because they thought it had an awesome metaprogramming paradigm. They would select it because of other reasons, and the few and "faulty" metaprogramming it has is just something you have to work with.

>inb4 use C/Forth/Go/Rust/D/Ada/Whatever instead of C++
It's easy to say, but see the real-world issues I listed. Not everyone has the luxury of writing completely isolated code entirely from scratch.
>>
>>52177014
Because there ends up being exactly one person in the world who understands your new language at the point you finish it.

Why even bother with C? Why don't we all just write our own compilers from ad hoc source languages to assembly? That sounds like a great idea, huh?
>>
I just finished reading my first book about python from start to end, I guess I don't have ADHD anymore, fuck school for making me read shit no one cares about, I'm an adult now bitch
>>
>>52177118
Sorry memester, C is a dead language.
>>
>>52177068
Lets have a race then, you implement a 4chan image scraper in C and I in Python and we'll see who does it the fastest and which of the implementations run the quickest.
>>
>>52177149
Oh I see, I can't say one good thing about a fucking language, and if I bring it up you get to shit on it but if I argue back it's annoying. Get over yourself.
>>
>>52177169
Writing an optimizing compiler literally takes years. Writing a custom C preprocessor takes maybe a day. If you design the language competently, it is not difficult for other people to pick up.
>>
>>52175319

Where do we find these people?
>>
>>52177182
Are you retarded?

>>52177199
Nah, I don't have a problem with arguing back but I'm sick of "F# this" and "F# that"
>>
>>52177190
>which of the implementations run the quickest.
The c implementation will run about 20x faster unless you're using primarily c libraries in python.

That doesnt discount development time or whether it matters that a webscraper finish in .01 seconds or .2 seconds, but making a challenge between c and python that includes performance is bold in a stupid way
>>
File: 547368.png (111 KB, 1120x1120) Image search: [Google]
547368.png
111 KB, 1120x1120
>http://archive.adaic.com/intro/ada-vs-c/cada_art.html

You have 10 seconds to explain why you haven't ditched C yet and started using the superior Ada programming language.
>>
>>52177212
It has legitimately good features and was completely relevant to the topic. Parts of F# were designed with metaprogramming and DSL in mind.
>>
>>52177200
LLVM is definitely a superior tool compared to emitting C code and invoking GCC or something
>>
>>52177169
>Why don't we all just write our own compilers from ad hoc source languages to assembly?

The entire post is nuts, but this has an error that should be corrected.

Compilers generally take it to machine language, not assembly language. I can imagine a compiler that would take it to assembly language and then using an assembler to create the executable file.
>>
>>52177190
are libraries allowed?
>>
>>52177234
grandpa pls
>>
>>52177167
>As I said, no sane person would select C++ because they thought it had an awesome metaprogramming paradigm
I'm not who you're replying to here but the original point in >>52176052 was that Java largely won out over C++ because of the complexity gripe. I think a sane person definitely could (and should) pick C++ over Java based on its metaprogramming capabilities.
>>
>>52177234

I hadn't heard anything about ADA in years. Do people still use it?
>>
>>52177234
I learned SPARK but there is almost no community at all.
>>
>>52177230
>The c implementation will run about 20x faster unless you're using primarily c libraries in python.
Which you would if you're not a complete retard.

The C implementation, would most likely use CURL which is notorious for being inefficient. You might use another API or even implement your own, but this would add considerable to development time.

Meanwhile, in Python you would use urllib and urllib2. These are already implemented, quite fast and yes they are implemented in C.

>That doesnt discount development time or whether it matters that a webscraper finish in .01 seconds or .2 seconds, but making a challenge between c and python that includes performance is bold in a stupid way
The point was that you can write an efficient webscraper in a matter of minutes in Python, and in order to do it "better" in C you would have to invest more development time.
>>
>>52177273
ada boy
>>
>>52177230
That's totally bullshit, 90% of runtime will be spent in IO.
>>
>>52177299
or use requests
>>
>>52177299
>he can't write his own CURL in under 20 minutes
>>
>>52177299
You don't need curl, making a http request via sockets is easy as fug
>>
>>52177252
Yes

>>52177234
The Linux kernel is written in C and writing kernel modules in anything but C is a pain and also a potential contribution will most likely not get accepted upstream.
>>
Protip: if you're writing a tool to turn a DSL into C, you're writing a compiler that uses C as a back end. Don't be retarded, use LLVM as a library.
>>
>>52177323
You're so funny. You have to honorate many http protocols to do it correctly.
>>
>>52177330
I'm rewriting the Linux kernel in Javascript. Will you contribute?
>>
>>52177323
>>52177316
What about TLS/SSL then?


>>52177315
Yes, modern Python code would probably do this instead. You are right.
>>
>>52177299
>Meanwhile, in Python you would use urllib and urllib2. These are already implemented, quite fast and yes they are implemented in C.
What's to stop you using them in your c implementation?
Why brag about python if you're just going to stand on the shoulders of c developers?
>>
>>52177251
>Compilers generally take it to machine language, not assembly language
I mean that's the default emission of like a C compiler but like GCC will spit out assembly if you ask for it. I don't know how it's done under the hood but I imagine if you need to produce both assembly and machine code then you might as well target assembly as an intermediary representation rather than compiling to machine code and disassembling or having two back ends.
>>
>>52177364
The funny thing is that all that idiot could have said was >>52177305, but instead he decided to totally throw away his credibility
>>
>>52177346
LLVM is not a standard, it's not fully portable, it is written in C++ and does not have multiple implementations for its api
not to mention that a C backend is easier
>>
>>52177174
that's cool, but what was the book about? your post was too boring for me to read it all
>>
>>52177364
>What's to stop you using them in your c implementation?
What would be the point of statically linking half of Python's runtime and part of Python's standard library and still call it a "C implementation"?

>Why brag about python if you're just going to stand on the shoulders of c developers?
What high-level programming language doesn't have a runtime implemented in C these days?

Also
>>52177305
This guy is correct. 90% of runtime will be I/O anyway.
>>
>>52177273

It's primarily used for military-grade safety critical systems. So, stuff like rockets, planes, space rovers, satellites, etc.
>>
File: cvx.jpg (165 KB, 1280x720) Image search: [Google]
cvx.jpg
165 KB, 1280x720
Anyone else restart router (to get new IP), delete cookies, and change user agent every now and then?

I hate that mods can see your entire post history across boards to be honest.
>>
>>52177391
>not to mention that a C backend is easier
Bull fucking shit.
>>
>>52177355
>What about TLS/SSL then?
gnutls, libressl, etc
easy
>>
>>52177380
Since we were discussing DEVELOPMENT TIME I brought up issues regarding DEVELOPMENT TIME in that post. For RUNTIME, the differences will be minuscule anyway.
>>
>>52177433
I'm pretty sure it's common knowledge by now that you can do just about everything faster in Python than in C
>>
>>52177400
>What high-level programming language doesn't have a runtime implemented in C these days?
Some JVMs huehuehue.
But a runtime is one thing, using c libraries is a whole other one.
>>
>>52177400
What would be the point if half of the libraries used are in C still call it a "Python implementation"?
You also said that they are written in C, you would not need to carry python with you.
>>
>>52177455
The poster I originally replied to ( >>52177068
and >>52176915 ) said that C is appropriate for everything C++ and Python is appropriate for, and implied, with his last post, even so in regards to development time.
>>
Library idea: something that allows you to build an AST that is emitted as C code
>>
>>52177491
It's called LLVM
>>
>>52177458
>But a runtime is one thing, using c libraries is a whole other one.
I wasn't talking about using C libraries, I was talking about using standard Python libraries. Most of these, when using CPython, are implemented in C.

>>52177468
>What would be the point if half of the libraries used are in C still call it a "Python implementation"?
Because they are part of the Python programming language.

>You also said that they are written in C, you would not need to carry python with you.
They are written in C, but they have a bunch of boilerplate stuff to work with Python objects. It's a fucking hassle to work with.

https://docs.python.org/2/extending/extending.html
>>
>>52177524
>>52177391
Everything except the "C backend is easier" part makes sense, and this would alleviate that
>>
>>52177205
No anon, they find us.
>>
>>52177531
>I wasn't talking about using C libraries, I was talking about using standard Python libraries. Most of these, when using CPython, are implemented in C.
So they're c libraries is what you're saying?
>>
>>52177531
>Because they are part of the Python programming language.
Is it part of the standard python library?
>>
>>52177414
>>52177534
I have to learn a new API that might be incompatible soon enough with later versions.
outputting C is as simple as a few printfs outputting C code.
>>
>>52177593
Autism
>>
>>52177601
I am a lazy autist. I prefer doing more constructive things than learning new APIs.
>>
>>52177601
He's right though -- that's how I've always done it. I literally use printfs + a custom parser to translate my AST into C, and I've never run into any issues.
>>
>>52177593
>>52177618
May I ask why the API would need to change if the C standard doesn't?
>>
>>52177557
>So they're c libraries is what you're saying?
No, they are Python libraries written in C. As is the case for any higher-level language standard library (see Java, C#, etc)

>>52177577
>>52177577
>Is it part of the standard python library?
Yes
>>
>>52177391
>does not have multiple implementations for its api
It does, just not in C/C++. For example, there's https://hackage.haskell.org/package/llvm-general-pure which is a full implementation of LLVM in pure Haskell.
>not to mention that a C backend is easier
There is one http://llvm.org/docs/doxygen/html/group__LLVMC.html (although idk how good it is)
>>
>>52177631
>>52177577
And by "part of the standard python library" I mean that they are included in a standard/default Python installation.
>>
>>52177205
he's right though, programming reveals the physical truth of mathematical constructivism and this terrifies the zionists with their love nihilisation and infinite sets
>>
>>52177412
Stop being a shitposter.
>>
>>52177628
Because I do not have trust in people keeping their libraries stable, while I have trust in the C standard committee.

>>52177659
Interesting but how much of LLVM API do they implement? And how alive and used are they?
>>
>>52177631
>>52177679
So, it isn't
>>
>>52177731
It is.

https://docs.python.org/2/library/

Can you stop shitposting now?
>>
>>52177631
>No, they are Python libraries written in C
Which is a c library being used by the python with python boilerplate.
Still a c library.
I'm just fucking with you at this point but I still think what you said originally was silly in the way you seemed to mean it
>>
>>52177779
python confirmed for best stdlib
>>
>>52177791
>Which is a c library being used by the python with python boilerplate.
>Still a c library.
Well, by this definition the entire HotSpot JVM is just a C library that parses Java bytecode and CPython interpreter is just a C library that parses Python...

>I'm just fucking with you at this point but I still think what you said originally was silly in the way you seemed to mean it
I'm not entirely sure what you are referring to now?
>>
Anyone happen to know a cool vectorised(/FORTRAN compiled) way to do this:

H2 = numpy.empty_like(H, dtype=bool)
for i in range(numpy.shape(T)[0]):
H2[i,:] = (H[i,:] > F[i])


Essentially I want to replace all the float elements in H by returning a boolean with True values if the element is greater than a single scalar float in F

An example would be
>>> H
array([[ 25., 5., 20., 1., 25.],
[ 1., 25., 20., 29., 25.],
[ 29., 20., 5., 1., 25.],
[ 5., 20., 25., 29., 25.],
[ 20., 5., 25., 1., 29.],
[ 25., 25., 5., 29., 1.]])
>>> (H > 3)
array([[ True, True, True, False, True],
[False, True, True, True, True],
[ True, True, True, False, True],
[ True, True, True, True, True],
[ True, True, True, False, True],
[ True, True, True, True, False]], dtype=bool)
>>>


Only instead of "3", every row should be compared to it's corresponding scalar in a vector "F".
>>
>>52177779
nice back-pedalling
>>
>>52177828
>posting link to counter poor trolling attempt = back-pedalling
Ok kid
>>
>>52177820
>Well, by this definition the entire HotSpot JVM is just a C library that parses Java bytecode and CPython interpreter is just a C library that parses Python...
Well, they're C programs using C libraries yes. But that's implementation level, not language library level which is why I don't believe it's valid to count it.
>>
>>52177828
Lol, you're the one who's baackpedaling, where is your C web scraper again?
>>
>>52177846
>claims something wrong
>I say something based on the wrong information given to me
>he back-pedals and calls my post trolling
top kek m8
>>
>>52177878
>that's implementation level, not language library level which is why I don't believe it's valid to count it.
Almost all of Java's standard library is implemented in C, and the same is true for Python.

Meaning that if you use ANY functionality at all, import any library at all from the standard libraries, you are essentially using a C library. By your definition, that is.
>>
>>52177920
>>52177889
>>52177846
Please stop going back and forth on this bullshit, if you want to continue to be stupid then please go to /b/
>>
>>52177932
>Almost all of Java's standard library is implemented in C
Pretty sure that's not true champ. I have no problem being proven wrong though. Ig grepcode is anything to go buy that isn't true though
>>
>>52177920
>You rhetorically asked if it was part of the standard library
>I claimed it was
>You tried to weasel your way out of it by repeating the rhetorical question
>I posted the link listing the actual contents of the standard library
>You called it "back-pedalling"

It's pretty obvious who's back-pedalling at this point...
>>
>>52177954
>when three people tell you you're wrong, you tell people go to go /b/
>not backpedaling
>>
/dpt/ is always so full of salt
>>
>tfw jai will never be released
>>
>>> for post in posts:
... if post["quality_post"]: print "Finally, a quality post on /dpt/"
...
>>>
>>
>>52177977
>Pretty sure that's not true champ.
How the fuck do you think the JVM is able to do multithreading, file I/O, sockets etc without having native C bindings to provide OS support?
>>
>>52178007
The only neat thing about Jai is that it natively supports SOA organization
>>
>>52178025
"All of it" was an exaggeration, but large parts of it (as in the parts >>52177977 said) requires it.

https://en.wikipedia.org/wiki/Java_Native_Interface
https://en.wikipedia.org/wiki/Java_Class_Library#Implementation_and_configuration
>>
>>52177986
It was not rhetorical

>>You tried to weasel your way out of it by repeating the rhetorical question
I repeated no question you shithead.

>I posted the link listing the actual contents of the standard library
>You called it "back-pedalling"
better explained in >>52177920
>>
>>52177977
I don't know how it's actually implemented but they could do it the same way C does, through syscalls
>>
>>52178025
The virtual machine takes care of that. Again, that's an implementation. The libraries themselves are entirely java
>>
>>52178060
I switched the posts around.

>>52178063
You were proven wrong. Just let it go instead of continuing to shitpost profoundly like some autistic manchild.
>>
>>52178050
build system looks cool
compile time execution too
joint allocations seem useful
>>
>>52178001
Im not him
>>
>>52177234
I like Ada, but Ada is overkill in the amount of type declarations you have to do. Go has borrowed a lot of ideas about using modules from Ada and Modula2 and so I would say that Go is a more practical language for getting things done
>>
>>52178081
>>52178065
See >>52178060

They use native C bindings.

Just like Python does.

>I don't know how it's actually implemented but they could do it the same way C does, through syscalls
How would you invoke a syscall from Java? It's not possible since the JVM is OS independent from Java's perspective.
>>
>>52178021
>python
>>
>>52178081
>Again, that's an implementation.
How is it somehow different for Python then?
>>
>>52178089
also i really like the syntax
>>
>>52178114
Try and top fizzbuzz of the Christ faggot, then you can shittalk Python
>>
File: 1447259870240.jpg (12 KB, 211x212) Image search: [Google]
1447259870240.jpg
12 KB, 211x212
if(IsImageMessageVisible = extensions.Contains(fileExtension)) //test if file is image
{


What operator should I replace '=' with to set IsImageMessageVisible to the reverse value of the if statement?
>>
File: out.webm (3 MB, 1280x1024) Image search: [Google]
out.webm
3 MB, 1280x1024
fucking multithreading
>>
If Java is written in C why is it so slow? Are Java programmers just shit?
>>
>>52178103
>They use native C bindings.
In the actual javacode? Because openJVM certainly doesn't, and the official JVM is based on it.
Thread replies: 255
Thread images: 33

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.