nrw.social ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Wir sind eine freundliche Mastodon Instanz aus Nordrhein-Westfalen. Ob NRW'ler oder NRW-Sympathifanten, jeder ist hier willkommen.

Serverstatistik:

2,8 Tsd.
aktive Profile

@jackpearse
Swift is there. With 9 code examples. Not much, but at least something.

@amarok Nice thanks. Swift belongs to a list of modern languages. Works perfektly on linux and is very powerful.

@jackpearse
Yes. I like Swift's syntax. But I'm not into Apple, so I don't think I will ever use it.

@amarok Swift is a powerful, clutterfree, expressive, clean, typesafe and memorysafe language. It is robust, portable and platform independent.

@jackpearse
I would definitely welcome if everyone using Python switched to Swift since Python is heavily overrated, there are many better alternatives. But I guess Python had a good marketing team 😉

I know Swift is not limited to MacOS/iOS, but still it's known as the "Apple language" because it has all the tools and APIs for MacOS/iOS available. My main lang is PHP (I can also really recommend it for shell scripting instead of Bash or Python). Do you know #vlang? A very cool new language.

@amarok You are right. Php more readable than bash. I fully agree. But I think we should stop creating a new dev langage every week. And instead focus on maintaing, let‘s say, three outstanding languages into very well maintainable Platform Independent languages for high wuality Applications. Every company is unsing another language. It is really hard nowaday to find people to do projects, because everyone uses another language.

@jackpearse
Well, PHP has been around since ages, it is a fully established and modern language which simply cannot disappear, I think it's still number 1 for web backend. But it's not a verstatile language since bindings to UI frameworks are no longer maintained, unfortunately.
I see what you mean by the advantages of a versatile language and I agree. But I personally cannot simply switch to another language since PHP (and JS) is part of my fulltime job, and connected to other frameworks I use

JackPearse

@amarok You are right. But I am not talking to deprecate old languages. I am more talking about stopping to constantly creating new ones. Instead we should be going the path of perfectioning of already existing once. Habe you tried ? Even that exists. There is so many languages around. But why don’t we ditch really outdated stuff, like crypic shell scripts in favour of well structured Languages. And why don’t we stop to always create new languages?

@jackpearse
Yes, makes sense. The answer probably lies in the human nature. People just want to create more and more of everything.
I fully agree with shell scripting, Bash, Perl and other languages which are _really_ weird and they only make life more complicated. They could be replaced by a more common and versatile language which people could also use elsewhere. That's one of the reasons I started using PHP also for shell scripting (for more complicated scripts).

@amarok What I really dislike about shell scripts is the sometimes really creepy typenof syntax. In those moments I ask myself: What has happened in the mind of the creator. I assume in those days it was more about hacking and patching that designing.

Inreally love the syntax of Swift. It is one of the most elegant languages in the world. Code poetry. But V, Koin, rust are very similar. But I really hate java. That approach is a dead end. LLVM and clang is the way to go.

@jackpearse
A few years back I took a short look at Kotlin and I am very picky about any language syntax, and I consider Kotlin's syntax to be bad.
var
val
fun
Are they serious? 😀 "var" and "val" look so similar, a language must be easily and quickly readable, with var and val it's confusing. And "fun", I don't know what the language designers were thinking, I don't want to write "fun", why didn't they choose "fn" or "func" instead like other languages?
Java is too verbose.

@amarok I also have trouble wirh ‚fun‘. That word gives me the impression that the language is a toy.

Swift also has ‚let‘ and ‚var‘.
At the first glance it makes no sense.

If you need a variable, use let. Like ‚let x=10‘. But that variable is not mutable. The compiler then might decide to make it const, static or inline in the assembly. If you use var, it becomes mutable. This assemles to a variable or a pointer. You tell the Compiler your intention to build efficent code.

@amarok But ‚var‘ and ‚val‘ can be truly easily confused. I prefer ‚let‘ and ‚var‘.

@amarok Try on linux. I am also picky about syntax. And I think swift did it one of the most elegant ways.
Unfortunately Installation of the framework is not so simple like i.e. rust. Linux is kind of still ignoring it a little bit. But the website explains it well. Install the libs. Download the package. Unzip. Move to your binary folder, i.e. /usr/local/swift
Set paths. And then swift —version should that it works.

is simple:
yay -S swift-bin

@jackpearse @roanutil
Thanks both, but I don't think I will try Swift anytime soon, maybe at some point later. (I have too much to do nowadays with starting my own business, learning all kind of new stuff. So I would get overwhelmed by even more documentation :-D )

@amarok @roanutil Sure. It’s your time. I just wanted to give you a starting point, should you be curious. Trying hello world is always worth it.

@jackpearse @roanutil
I looked into my Replit.com account and Swift is also available there, nice. Replit is probably the easiest way to try out any language.
Unfortunately they reduced the maximum number of public projects to 3, but it's still useful, now they even integrated an AI chat bot.

@amarok Comparison:
rust:
cargo new <app name>
cargo build
cargo run

Manifest: Cargo.toml
Language-Code: rust
Manifest-Code: toml

swift:
mkdir <project>
cd <project>
swift package init —name <project> —type executable

swift build
swift run

Manifest: Package.swift
Language-Code: swift
UI-Code: swift
Manifest-Code: swift

One syntax for Everything!

See: swift.org/getting-started/cli-

Just give it a try. It’s worth it. ;-)

Swift.orgSwift.orgSwift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.

@amarok Sometimes I think people are too lazy to learn what’s already there. And then they start to write their own compiler.

@amarok By the way. Uave you ever tried the language ?

You should give it a try ;-)

@jackpearse
I know this language exists, I've seen examples. Really crazy :-D I don't even want to understand how the syntax works, I know there must be a cryptic logic behind it.

@amarok It’s a simplified turing machine. You should write a hello world. It’s fun to understand the fundamental therory of „algorithm“ from this point of view.