Screenshots. Print screen. Wayland famously doesn't have a way to do this very basic task (all of the desktop environments had to add custom extensions).
Seems like they finally did it though really recently. And it only took 12 years!
Screenshots. Print screen. Wayland famously doesn't have a way to do this very basic task (all of the desktop environments had to add custom extensions).
Seems like they finally did it though really recently. And it only took 12 years!
No but I think this is probably a great use case for AI. Haven't tried it though.
One nice thing about XML is that there's an official way to link to the schema from within the document. If you do that you can easily automatically validate it, and even better you get fantastic IDE support via Red Hat's LSP server. Live validation, hover for keys, etc.
It's a really nice experience and JSON schema can't really match it.
That said, XML just has the wrong data model for 99% of use cases.
It has them, but you can't use them from a single-file script. You have to set up a pyptoject.toml
, create a venv
and then pip install .
in it. Quite a lot of faff. It also makes some things like linting in CI way harder than they should be because the linters have to do all that too.
With Deno a single .ts
file can import third party dependencies (you can use any URL) and Deno itself will take care of downloading them and making them available to the script.
Some other languages have this feature to certain degrees. E.g. I think F# can do it, and people are working on it for Rust, but Deno is at the forefront.
Yeah exactly. You made it faster through algorithmic improvement. Like for like Python is far far slower than C++ and it's impossible to write Python that is as fast as C++.
The only interpreted language that can compete with compiled for execution speed is Java
"Interpreted" isn't especially well defined but it would take a pretty wildly out-there definition to call Java interpreted! Java is JIT compiled or even AoT compiled recently.
it can be blazingly fast
It definitely can't.
It would still be blown out of the water by similarly optimized compiled code
Well, yes. So not blazingly fast then.
I mean it can be blazingly fast compared to computers from the 90s, or like humans... But "blazingly fast" generally means in the context of what is possible.
Port component to compiled language
My extensive experience is that this step rarely happens because by the time it makes sense to do this you have 100k lines of Python and performance is juuuust about tolerable and we can't wait 3 months for you to rewrite it we need those new features now now now!
My experience has also shown that writing Python is rarely a faster way to develop even prototypes, especially when you consider all the time you'll waste on pip and setuptools and venv...
Unless the C++ code was doing something wrong there's literally no way you can write pure Python that's 10x faster than it. Something else is going on there. Maybe the c++ code was accidentally O(N^2) or something.
In general Python will be 10-200 times slower than C++. 50x slower is typical.
threading bugs are sometimes hard to catch
Putting it mildly! Threading bugs are probably the worst class of bugs to debug
Definitely debatable if this is worth the risk of impossible bugs. Python is very slow, and multi threading isn't going to change that. 4x extremely slow is still extremely slow. If you care remotely about performance you need to use a different language anyway.
formatting does depend on the type of variables. Go look at ktfmt’s codebase and come back after you’ve done so…
I skimmed it. It appears to visit the AST of the code and format that, as any formatter does. ASTs have not been type checked.
Can you give an example?
it gives you an option, just like if it was an interface. Did you actually try this out before commenting?
Precisely! It doesn't know the answer so it has to guess, or make you guess.
And how often are you naming functions the exact same thing across two different classes without using an interface?
You mean how often does the same field name come up more than once? All the time obviously! Think about common names like id
, size
, begin
, children
, etc. etc.
I’m sorry, but you clearly haven’t thought this out, or you’re really quite ignorant as to how intellisense works in all languages (including Ruby, and including statically typed languages).
I'm sorry but you clearly haven't thought this through, or you're just happy to ignore the limitations of Ruby. I suspect the latter. Please don't pretend they aren't limitations though. It's ok to say "yes this isn't very good but I like Ruby anyway".
I can give you some basic Python set-up advice (which is hard-won because nobody tells you this stuff):
pyproject.toml
, not requirements.txt
. It's better and it's the recommended way.def main():
...
if __name__ == "__main__":
main()
There are two reasons:
Other minor things:
Path
has a crazy/neat override of the /
operator so you can do Path("foo") / "bar" / "baz.txt"
.assert
for stuff that the user might reasonably do (like not choosing a background image). assert
is meant to be for things that you know are true. You are asserting them. Like "hey Python, this is definitely the case".Never to be seen again...
Seriously though this feels a lot like those books that start with "How to read this book" sections.
Nice work. Aren't wasm proc macros already prototyped in Watt though?