Swift

computer:~ user$ cat main.swift
let a:[Int] = [1] + [2] + [3] + [4] + [5] + [6] + [7]
computer:~ user$
computer:~ user$ time swiftc main.swift
main.swift:1:49: error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
let a:[Int] = [1] + [2] + [3] + [4] + [5] + [6] + [7]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

real 1m8.421s
user 1m5.992s
sys 0m2.252s

The ABSOLUTE STATE of Swift

Attached: swift-og.png (300x300, 22K)

Other urls found in this thread:

github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md
twitter.com/NSFWRedditGif

what the fuck lol

Autist

Exponencial type system oh

>rockstar compiler fag makes meme lang pet project
>convinces apple to completely switch to it for all ios + macos dev in future
>lang is dog shit slow to run and compile, compiler segfaults, ide syntax coloring etc breaks on simple statements, etc
>web server written in Swift+C slower than fucking Django
>jumps ship to google to work on TensorFlow
>releases blog post with ass backwards reasoning why TF should use Swift
github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md
L M A O
how long can he get away with it?

Attached: ChrisPhoto3-Large.jpg (1344x1502, 414K)

okay seriously, how could this happen? Lattner is really fucking smart and very experienced. how did his project turn out so badly?

I assume he threw lang and compiler autism into design but never had resources from Apple to actually optimize it.
The number of man hours JVM or Haskell has had in comparison is insane and my impression is that Swift's design is even more resistant to making it performant/fast compile times etc.
Plus it's necessarily hamstrung by needing to use existing Cocoa/IoS etc apis patterns.

I have no idea how he convinced Apple to back it 100% though. Seems like a clusterfuck lol.

That's a big yikes from me dawg

>design new language
>purposely make it simple, dumb, and rote for your smart but not genius nooby employees
>performs well
>GC pause times in microseconds (no ARC autism)
>multiple big projects on multiple platforms using it
He's a goober but he pulled it off.

Attached: rob_pike.jpg (500x335, 20K)

pike created Go not Swift

when the rust compiler beats you in time, now that's just embarrassing.
$ cat concat.rs
fn main() {
let a = [[1], [2], [3], [4], [5], [6], [7]].concat();
println!("{:?}", a);
}

$ time rustc concat.rs && ./concat

real 0m0.224s
user 0m0.000s
sys 0m0.016s
[1, 2, 3, 4, 5, 6, 7]

I know, that's describing Go.
Even for stuff like package versioning, or no generics, or verbose rote error handling (all of which gopher fags praise) it's still pragmatic, performant, and actually being used for real things.

Swift is only relevant because it's (or will be) mandatory for ios devs.
Apple should hire Walter Bright and have him save their ass.

>python -m timeit "[1] + [2] + [3] + [4] + [5] + [6] + [7]"
1000000 loops, best of 3: 0.648 usec per loop

>I know, that's describing Go.
>posting about Go in a thread bout Swift

There both newish langs from Big Tech and both creators are at Google now.

Yeah, but it's not starting the python compiler ("compiler") and re-compiling the same expression every time, is it? Execution time is a different story.

CL-USER> (time (let ((a (concatenate 'list '(1) '(2) '(3) '(4) '(5) '(6) '(7))))
(declare (type (cons integer) a))
a))
Evaluation took:
0.000 seconds of real time
0.000004 seconds of total run time (0.000004 user, 0.000000 system)
100.00% CPU
3,840 processor cycles
0 bytes consed

(1 2 3 4 5 6 7)

>There
>illiterate fag doesn't appreciate the simple beauty of go
HUR WHY ME CHECK RETURN VALue? ???

test.py
a = [1] + [2] + [3] + [4] + [5] + [6] + [7]


C:\Users> powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
>C:\Users> Measure-Command {py .\test.py}
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 258
Ticks : 2585115
TotalDays : 2,99203125E-06
TotalHours : 7,180875E-05
TotalMinutes : 0,004308525
TotalSeconds : 0,2585115
TotalMilliseconds : 258,5115

try syntax SOON gopher

computer:~ user$ cat main.swift
let a:[Int] = [1] + [2] + [3] + [4] + [5] + [6]
computer:~ user$
computer:~ user$ time swiftc main.swift

real 0m52.351s
user 0m48.618s
sys 0m1.837s

Six elements actually compiles but takes 50 seconds.
I understand complicated type systems or dependency systems having exponential cases but cases like this should not trigger it.
Yikes.

Attached: 1562500701113.jpg (464x439, 79K)

Yeah, that makes a lot more sense, it doesn't have to write an executable either.