TypeScript for Python

TypeScript for Python

Postby Lyberta » 16 Sep 2019, 03:10

Deleted.
Last edited by Lyberta on 01 Oct 2021, 09:56, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: TypeScript for Python

Postby fluffrabbit » 16 Sep 2019, 04:18

As much as I would like to see the combination of two things I don't care for individually, Python isn't really optimized for speed, which is one of the advantages of static languages. Lobster is Pythonic with static types, with optional type notation AFAIK. It's evolving fast.
fluffrabbit
 
Posts: 557
Joined: 11 Apr 2019, 11:17

Re: TypeScript for Python

Postby Lyberta » 16 Sep 2019, 10:38

Deleted.
Last edited by Lyberta on 01 Oct 2021, 09:57, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: TypeScript for Python

Postby fluffrabbit » 16 Sep 2019, 17:21

Try a different build system, but also, the Unix shell and many other scripting languages are either untyped or dynamic for simplicity.
fluffrabbit
 
Posts: 557
Joined: 11 Apr 2019, 11:17

Re: TypeScript for Python

Postby Ntech » 16 Sep 2019, 19:52

Lyberta, try Python's Ctypes. It allows you to declare variables, and offers significant speed increases.
Deo gratias, Ave Maria
User avatar
Ntech
 
Posts: 94
Joined: 30 May 2019, 20:40

Re: TypeScript for Python

Postby O01eg » 16 Sep 2019, 20:06

There is a http://mypy-lang.org/ type checker. It looks like TypeScript but doesn't recompile python code, because python already supports type annotations.
Public FreeOrion multiplayer server: https://freeorion-test.dedyn.io/
Slow paced multiplayer server (registration required!): https://freeorion.org/forum/viewtopic.p ... 705#p95705
Donates for FreeOrion multiplayer improvements: BTC:bc1q04qnmql47zkha6p4edl86hm0wgk90dmsfnl3vl
O01eg
 
Posts: 68
Joined: 17 Sep 2012, 11:15
Location: Russia

Re: TypeScript for Python

Postby Lyberta » 17 Sep 2019, 03:49

Deleted.
Last edited by Lyberta on 01 Oct 2021, 09:57, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: TypeScript for Python

Postby O01eg » 17 Sep 2019, 04:35

O01eg {l Wrote}:There is a http://mypy-lang.org/ type checker. It looks like TypeScript but doesn't recompile python code, because python already supports type annotations.


It doesn't recompile so it's optional. I want something that's mandatory.

Anyway, here's my conanfile.py for my game engine:

{l Code}: {l Select All Code}
from conans import ConanFile, CMake

class ftzEngineConan(ConanFile):
   name = "ftzEngine"
   version = "Latest"
   license = "GNU AGPLv3+"
   url = "https://ftz.lyberta.net/projects/engine/"
   description = "An experimental 2D game engine"
   settings = "cppstd", "os", "compiler", "build_type", "arch"
   requires = "ftzGeneral/Latest@Lyberta/Latest", "ftzPlatform/Latest@Lyberta/Latest", "ftzSerialization/Latest@Lyberta/Latest", "ftzConsole/Latest@Lyberta/Latest", "ftzUnicode/Latest@Lyberta/Latest", "ftzNetworking/Latest@Lyberta/Latest"
   build_requires = "ftzGeneral/Latest@Lyberta/Latest", "ftzPlatform/Latest@Lyberta/Latest", "ftzSerialization/Latest@Lyberta/Latest", "ftzConsole/Latest@Lyberta/Latest", "ftzUnicode/Latest@Lyberta/Latest", "ftzNetworking/Latest@Lyberta/Latest"
   generators = "cmake"
   exports_sources = "Src/Engine/*", "CMakeLists.txt"

   def build(self):
      cmake = CMake(self)
      cmake.configure(source_dir = self.source_folder)
      cmake.build()

   def package(self):
      self.copy("*.h", dst="Include", src="Src/Engine/Include")
      self.copy("*.hpp", dst="Include", src="Src/Engine/Include")
      self.copy("Lib/libftzengine.so", dst="lib", keep_path=False)

   def package_info(self):
      self.cpp_info.includedirs = ["Include"]
      self.cpp_info.libs = ["ftzengine"]


So I'd like to write it in statically typed language then compile to Python then I run Conan and it executes this Python script to build and package my engine.[/quote]

Looks like Conan is going to have type annotations https://github.com/conan-io/conan/issues/4177 to help type checkers.
Public FreeOrion multiplayer server: https://freeorion-test.dedyn.io/
Slow paced multiplayer server (registration required!): https://freeorion.org/forum/viewtopic.p ... 705#p95705
Donates for FreeOrion multiplayer improvements: BTC:bc1q04qnmql47zkha6p4edl86hm0wgk90dmsfnl3vl
O01eg
 
Posts: 68
Joined: 17 Sep 2012, 11:15
Location: Russia

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron