224
submitted 4 days ago* (last edited 4 days ago) by QuinnyCoded@sh.itjust.works to c/showerthoughts@lemmy.world

also I just realized that Brazil did NOT make a programming language entirely in Spanish and call it "Si" and that my professor was making a joke about C... god damn it

this post is probably too nieche but I feel like Lemmy is nerdy enough that enough people will get it lol

you are viewing a single comment's thread
view the rest of the comments
[-] PeriodicallyPedantic@lemmy.ca 14 points 3 days ago

I'll hate on python (or any dynamically typed lang) as much as the next guy, but let's not be language snobs

[-] cooligula@sh.itjust.works 14 points 3 days ago

Why would you hate on it? It has its usecases. You won't build an OS in Python, but I'd much rather do data processing in Python than in C

[-] buttnugget@lemmy.world 4 points 3 days ago

Maybe I’ll build an OS in Python just for the fun of it! Haha

[-] cooligula@sh.itjust.works 2 points 3 days ago

You just cannot do it, I'm afraid. Python is an interpreted language, and requires de CPython library to be translated into machine code so that it can then be run, but that requires an underlying OS that makes the calls. The closest thing would be micropython, which can be run inside the Linux kernel, but that's about it. The only thing I can think of is using a custom compiler that would generate either C/C++ or assembly code from a Python script, and then compile it using a standard C/C++/assembly compiler.

[-] MonkderVierte@lemmy.zip 2 points 3 days ago* (last edited 3 days ago)

The closest thing would be micropython, which can be run inside the Linux kernel

So, there?

[-] cooligula@sh.itjust.works 3 points 3 days ago

That is not the same as building an OS in Python hahaha

[-] buttnugget@lemmy.world 1 points 3 days ago

Well shoot! This is really interesting though. I’m not a programmer, but I think I understand the basics of this.

[-] PlexSheep@infosec.pub 1 points 3 days ago

Guess they have to write a python compiler first then.

[-] MonkderVierte@lemmy.zip 1 points 3 days ago* (last edited 3 days ago)
[-] PeriodicallyPedantic@lemmy.ca 2 points 3 days ago

I hate on it mainly for its lack of static typing.
I tried building a HomeAssistant add-on in python, and it was not a good experience. Idk what IDE python devs usually use but VSCode did not provide much assistance.

[-] cooligula@sh.itjust.works 4 points 3 days ago

You can in fact statically type in Python. For example, defining variables:

six: int = 6
hello_world: str = "Hello World!"

Or defining functions:

def foo(x: int) -> int:
    return x**2

If you only want to use static Python, you can use the mypy static checker:

# Install mypy if you don’t have it
pip install mypy

# Run the checker on the file (e.g., example.py)
mypy example.py
[-] Kornblumenratte@feddit.org 2 points 3 days ago

That's just a fancy way of commenting on the intended types, no static typing though.

Python will happily execute:

six: int = 6
six = "Hello World!"
[-] cooligula@sh.itjust.works 2 points 3 days ago

But mypy will not accept it :)

[-] Omgpwnies@lemmy.world 1 points 3 days ago

What you're describing is type hints, it's syntactic sugar and not used at all by the interpreter.

For example, this is a "legal" statement:

foo: int = "bar"

Your IDE and linter will complain, but the interpreter just chops the hints off when compiling, and it's left with foo = "bar"

[-] PeriodicallyPedantic@lemmy.ca 1 points 3 days ago

I was using that syntax, but nothing seemed to be checking it. Running an external app to get static checking done isn't great, presumably there are extensions for common IDEs?

But the poor vscode developer experience went beyond that. I attribute it to dynamic typing because most of my frustration was with the IDE's inability to tell me the type of a given variable, and what functions/properties were accessable on it.

I hope it'd be better on an IDE made specifically for python, although idk how many extensions I'd have to give up for it, and things like devcontainers.

[-] MonkderVierte@lemmy.zip 1 points 3 days ago

But the poor vscode developer experience went beyond that.

Yeah, vscode is too laggy.

[-] buttnugget@lemmy.world 2 points 3 days ago

I am currently taking a Python class and we are using PyCharm I’m not a developer, so I don’t know if it’s good yet.

[-] QuinnyCoded@sh.itjust.works 2 points 3 days ago* (last edited 3 days ago)

i didn't say anything negative about it, I like both languages (though python is way easier). i was just stoned and made an observation

this post was submitted on 20 Oct 2025
224 points (100.0% liked)

Showerthoughts

37852 readers
803 users here now

A "Showerthought" is a simple term used to describe the thoughts that pop into your head while you're doing everyday things like taking a shower, driving, or just daydreaming. The most popular seem to be lighthearted clever little truths, hidden in daily life.

Here are some examples to inspire your own showerthoughts:

Rules

  1. All posts must be showerthoughts
  2. The entire showerthought must be in the title
  3. No politics
    • If your topic is in a grey area, please phrase it to emphasize the fascinating aspects, not the dramatic aspects. You can do this by avoiding overly politicized terms such as "capitalism" and "communism". If you must make comparisons, you can say something is different without saying something is better/worse.
    • A good place for politics is c/politicaldiscussion
  4. Posts must be original/unique
  5. Adhere to Lemmy's Code of Conduct and the TOS

If you made it this far, showerthoughts is accepting new mods. This community is generally tame so its not a lot of work, but having a few more mods would help reports get addressed a little sooner.

Whats it like to be a mod? Reports just show up as messages in your Lemmy inbox, and if a different mod has already addressed the report, the message goes away and you never worry about it.

founded 2 years ago
MODERATORS