Page 1 of 1

TypeScript for Python

PostPosted: 16 Sep 2019, 03:10
by Lyberta
Deleted.

Re: TypeScript for Python

PostPosted: 16 Sep 2019, 04:18
by fluffrabbit
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.

Re: TypeScript for Python

PostPosted: 16 Sep 2019, 10:38
by Lyberta
Deleted.

Re: TypeScript for Python

PostPosted: 16 Sep 2019, 17:21
by fluffrabbit
Try a different build system, but also, the Unix shell and many other scripting languages are either untyped or dynamic for simplicity.

Re: TypeScript for Python

PostPosted: 16 Sep 2019, 19:52
by Ntech
Lyberta, try Python's Ctypes. It allows you to declare variables, and offers significant speed increases.

Re: TypeScript for Python

PostPosted: 16 Sep 2019, 20:06
by O01eg
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.

Re: TypeScript for Python

PostPosted: 17 Sep 2019, 03:49
by Lyberta
Deleted.

Re: TypeScript for Python

PostPosted: 17 Sep 2019, 04:35
by O01eg
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.