7 ms·
You can replace Python in Ruby or Lua for the most part and also Android with iOS. Dynamic languages aren't yet a big deal and I think it's because they don't b
by programminggeek 13y ago
You can replace Python in Ruby or Lua for the most part and also Android with iOS. Dynamic languages aren't yet a big deal and I think it's because they don't bind well or give you a significantly better developer experience than Objective-C or Java on these platforms do.
RubyMotion is probably the closest I've seen to making a language like Ruby or Python a very compelling mobile developer experience while maintaining the end user experience.
That basically means you need to write a Python compiler for iOS or Android to make it compelling, which means adding type checking and at some point developers start asking why they aren't just using Java in the first place...
- camus2 13y agothe irony is the use of javascript in solutions like Titanium,to code ANYTHING but the ui ( the business logic is in javacript , the ui is native ). I like the approach though, it's a better approach than phonegaps and likes. the only drawback : doesnt seem the engine they use is opensource.
- dottrap 13y agoIn Titanium, you code both the business logic and UI in Javascript. The Javascript UI APIs Titanium provides call native APIs under the hood. Titanium is open source; the repository can be found on GitHub.
- gcb1 13y agoThose languages does not focus on portability.
- petsagouris 13y agoThe main focus of Lua has been portability.
- gcb1 13y agointo other languages, not systems.
- pekk 13y agoIf you think Python is a worse Java then there is something important you have missed.
- raverbashing 13y ago"write a Python compiler for iOS or Android to make it compelling, which means adding type checking" No PyPy is a (JIT) compiler for Python, no type checking addition needed.
- eonil 13y agothe point is adding type system, not compiling it.
- nilliams 13y agoPython has a type system.
- Alphasite_ 13y agoEnforced type system is probably what he meant, i.e. annotations had a practical application at the moment.
- nilliams 13y agoI'm not just being purposefully obtuse here. When read in the context of his upstream comments, I don't think we can make any assumptions as to what he meant.
- eonil 13y agoAt least, what I mean was an ability to offer those type informations to automated tools - auto-completion system. How actually Python type doesn't matter. Python lacks the ability by not forcing type (an)notation. This is fundamentally different with type-inferencing/deducing system such as Haskell, Go, C++11.
- klibertp 13y agoI think it's not "fundamentally different". Type info is there in the code, it's just much more implicit and requires much more work to extract and use. One thing which does just this is Jedi project (for python) and it's absolutely astonishing how much data you can get out of it! Also I think that dynamic languages were meant to run inside a dynamic environment. For example in Pharo Smalltalk (probably all Smalltalks) every single piece of metadata is runtime data. Static analysis has no sense, because in Pharo there is no "static" at all - everything happens inside a living environment and (for example) as soon as you write a method it's turned into CompiledMethod object which has all the data about the method you would ever need for you to query easily. Good luck implementing better refactoring tools than those in Smalltalk for any other language. Essentially the same approach is used in Emacs Lisp. For example, if you see a function you don't recognize, you can jump to it's definition. The thing here is that Emacs doesn't know where the definition is because of static analysis - it just has this compiled chunk of code in memory which happens to have a name you're looking for. This chunk of code knows a location of it's definition and many other pieces of metadata which are all available on runtime. It of course doesn't work if the function isn't already loaded into Emacs. Most statically typed languages retain almost no type data in runtime. Most dynamically typed languages have almost no type data on compile time. I see this as largely equivalent. So I guess what I want to say is that there is no fundamental difference in what the dynamic and static languages are, but there is (and should be) a very fundamental difference in how they are used. Choosing the between the two is I think almost exclusively a matter of preference. A good programmer should feel comfortable with both, though.
- starnix17 13y agoLua can easily be compiled and used on both Android and iOS.
- eonil 13y agoI like to add some more. That's correct that the type system is the crucial attribute as a platform language. But that's not the only reason. It's also for correctness, safety, productivity and manageability. That's because a platform is huge and complex monster. So all those properties are archive-able only by automated tools, and those tools need rich metadata for each word of code. Type information is crucial metadata, and it's mostly impossible to make high quality tools without those informations. That's why all the designed modern platform (=system) languages are all mostly typed. From C/C++/Objective-C, to Java, C#, Go, Rust, Dart, TypeScript… In fact, it doesn't matter the language actually statically typed, dynamically typed, duck-typed, or completely untyped. The point is an ability to offer accurate metadata for automated tools, and type system is the best ever invented. So languages lacks the ability cannot be a platform's primary language.
- nawitus 13y agoExactly. I've never understood why someone would prefer a untyped language. It's just a bad developing experience, code needs more debugging, it is harder to maintain and overall productivity is lower. Untyped languages are fine only for small scripting languages.
- vidarh 13y agoI doubt you really mean untyped languages. Untyped languages includes many assembly languages, BCPL and some Forths. It does not include typical scripting languages like Perl, Ruby or Python - all of which are strongly typed.
- chrismonsanto 13y agoTo be pedantic, assembly languages do generally have multiple types, if by 'type' we mean 'a set of values disjoint from other sets of values'. For example, x86 has the types integer, floating point, MMX, SSE, and registers of these types cannot be confused for each other. It's just that these classifications/types aren't so useful, and we can't make our own (and perhaps all we really wanted was a distinction between integer and pointer)
- davvolun 13y ago> at some point developers start asking why they aren't just using Java in the first place... Hasn't held anyone back on non-mobile systems, right?