How is the versioning of Jython? - jython

How is the versioning of Jython? If I install Jython 2.5 does it mean that I can program in Python 2.5 syntax in spite of Python3.3 or the Jython versioning system is dependent?
By now the last version of Jython available for production is 2.5.3. If the versioning of Jython is based on Python, it looks deluding to be able to program only In Python 2.5 or earlier.

Jython x.y.z means that it's spec compatible with Python x.y, e.g. Jython 2.5.3 is compatible with Python 2.5 versions. (Python 2.5 introduced the "with" statement aka context manage. This has been implemented in Jython 2.5.)
As implementing each new version is a lot of work and the Jython project has not enough resources to keep up with all versions it was decided to not implement all intermediate versions.
The PyPy project aims to avoid this by abstracting and automating the transformation to a concrete runtime system (native, jvm, .net, etc.)
I don't understand the part "in spite of Python 3.3" in your question.

1.3 Is Jython the same language as Python?
Yes. Jython is an implementation of the Python language in Java. We strive to ensure that Jython remains as compatible with CPython as possible. The latest Jython release (2.2) implements the same language as CPython 2.2 and many of the CPython standard library modules.
There are two incompatibilities with modern CPython that often catch newcomers. First, Jython 2.2 does not implement any features added to CPython in version 2.3 or later. This includes language features such as decorators, and library modules such as optparse. A more modern version of Jython is under active development.
Second, Jython programs cannot use CPython extension modules written in C. These modules usually have files with the extension .pyc, .pyd or .dll. If you want to use such a module, you should look for an equivalent written in pure Python or Java.
There are a number of other differences between the two implementations that are unlikely to go away. These range from the trivial - Jython's code objects don't have a co_code attribute because they don't have any Python bytecodes; to the significant - Jython uses Java's true garbage collection rather than Python's reference counting scheme.
http://jython.sourceforge.net/docs/differences.html
Python has never really had much of a language definition beyond it's C-based implementation. The existence of Jython changed that for the first time and will hopefully lead to a much clearer sense of what Python the language is; independent of any specific implementation.
From: http://www.jython.org/archive/22/userfaq.html#id4
To me it seems that you only have access to Python2.5 if you are using Jython 2.5.3.

Related

How to make a single, cross-platform EXE file in Python 3.7

I've tried PyInstaller, but it doesn't support Python 3.7. I'm using Python 3.7 features, so I don't want to downgrade to 3.6. How can I make my program a single-file, cross-platform executable?
Have you tried to use cx_Freeze? For Python 3.7, you need to apply the bugfix described in this answer by hand to your local cx_Freeze installation until a corrected version has been released.
cx_Freeze itself does not support building a single-file executable, but you can use further tools for this purpose as described here.
This depends on what you mean by "EXE file".
If you can jam all your source code into a single.py file then that would likely be the closest to a cross platform executable. It would just require having a python interpreter pre-installed on each OS.
If you are referring to a literal .exe executable file that works cross platform; for python programs this is impossible. Python compiles down to machine code in the same way that C and C++ do, which is platform specific. Unlike Java, which runs on a VM, if you wish to compile your python program into a single executable file, then the file will only work on whatever platform it was compiled on.

Install script for OmniBrowser for Pharo 1.3?

Please do not promote Nautilus or Glamour here. I'm using Pharo 1.3 (without plans to migrate to Pharo 1.4 or 2.0). It seems to be many version of OmniBrowser out there. Which one is the most tested (in the sense of coverage) or just buggy-free?
http://www.squeaksource.com/PharoOB
http://source.lukas-renggli.ch/ob21
http://source.lukas-renggli.ch/omnibrowser
http://source.wiresong.ca/ob/
...and probably more
I have some questions for it:
Does it work with Shout correctly?
Can I load it without the AST and Refactoring Engine?
Can I load it without Morphic?
It is compatible with any version of Squeak?
It is loadable in Cuis?
Thanks
Omnibrowser is pre-installed in Pharo 1.3.
If you're talking about installing it in 1.3 core, use:
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfOmniBrowser';
load.
((Smalltalk at: #ConfigurationOfOmniBrowser) project perform: #version: with: '1.3') load: #( Dev ).
As to your other questions...
Does it work with Shout correctly? Yes.
Can I load it without the AST and Refactoring Engine? Yes. Load the #Core group instead of #Dev.
Can I load it without Morphic? No.
It is compatible with any version of Squeak? Yes. You can load it into Squeak 4.2 and 4.3 with:
Installer ss
project: 'MetacelloRepository';
install: #ConfigurationOfOmniBrowser.
((Smalltalk at: #ConfigurationOfOmniBrowser) project perform: #stableVersion) load: #( Dev ).
Although there seem to be some problems with it. For instance, refactorings didn't seem to take, and I had to change a few #createCompletionController methods, as errors came up, to:
createCompletionController
^ OController model: self
It is loadable in Cuis? Highly doubtful.
The repository http://source.wiresong.ca/ob/ is the official OmniBrowser repository for Squeak (using Tool-Builder). The repository http://source.lukas-renggli.ch/omnibrowser is the official OmniBrowser repository for Pharo (using Polymorph). In both repositories the core packages are identical and mirrored regularly.
The repository http://source.lukas-renggli.ch/ob21 is outdated, it stems from an experiment that I started many years ago. I removed the repository for now to avoid further confusion. All other repositories (as well as the various Metacello configurations) are based on outdated and forked code. The code you get there lacks many improvements and misses important fixes that had been implemented a long time ago.
For Pharo 1.3, as Philippe points out, you have to merely file-in https://github.com/renggli/builder/blob/master/scripts/omnibrowser.st to get a stable installation. Shout, eCompletion, the Refactoring Engine, and various other extensions are optional. Just remove the parts you don't need from the script. Technically Morphic is not needed either, but then you don't get a default user-interface. There are several other interfaces like OB-Web and OB-Mars that you could load, but I don't know how well they currently work.
The same file-in also works in Squeak. You just have to replace the following packages:
Refactoring-Pharo-Platform with Refactoring-Squeak-Platform (if you want the refactoring engine)
OB-Pharo-Platform with OB-Squeak-Platform
OB-Polymorph with OB-ToolBuilder
Shout is preinstalled in Squeak and not needed
eCompletion does not work in Squeak (as far as I know)
I don't think OmniBrowser works in Cuis. It could be made to work by providing the necessary platform and UI packages. OmniBrowser is unlikely to ever be supported in Pharo 1.4 or Pharo 2.0, because central parts of the reflective system (such as MethodReference and SystemNavigation) changed drastically.
I use the one from http://source.lukas-renggli.ch/omnibrowser because I know where Lukas lives ;-) Lukas has been maintaining it for several years now and I've never had any issues. Having that said it only really works in Pharo 1.3.
Does it work with Shout correctly? Yes
Can I load it without the AST and Refactoring Engine? Yes
Can I load it without Morphic? No
It is compatible with any version of Squeak? No, only Pharo 1.3
It is loadable in Cuis? No, only Pharo 1.3
I use the load script from
https://github.com/renggli/builder/blob/master/scripts/omnibrowser.st unfortunately there is no Metacello configuration.

Is it possible to import WebSphere wsadmin as a jython module?

In WebLogic, there's the WLST (WebLogic Scripting Tool) which is similar to WebSphere wsadmin. The nice thing about WLST is that you can import it as a module into other jython code and use it without any dependencies.
Here's link that discusses this:
http://ghattus.com/2006/01/06/wlst-as-a-jython-module/
Is the same thing possible with WebSphere wsadmin?
No.
wsadmin is "scripting framework" not originally created with jython in mind. It was intented to be used with TCL. After that it was "abstracted" so that (m)any popular scripting languages can be used inplace of TCL, and only Jython was provided by actual WAS instalation.
Leaving an api desing which is certainly not very pythonic or efficient.
Anyway neither of 5 main objects of wsadmin are python objects, and some of them are even constructed (like source code is being literally created with merging strings) as wsadmin loads.
But you can do something else. wsadmin can be run outside WAS as standalone program. And it can be even upgraded with jython 2.5, so you can run newer python code within wsadmin.
Hope this helps..

Functional languages compatible with Mono

Is F# the only actively-developed functional language for the CLI, which supports Mono and has Monodevelop plug-in? or are there others I missed?
F# is pretty fun, but it's not as awesome as a lisp like clojure which sadly doesn't support mono yet.
There's IronScheme, Clojure (or more precisely ClojureCLR) and Nemerle. The CLI port of Scala picked up steam again a couple of months ago and is even sponsored by Microsoft, although AFAIR the projected feature-parity release (i.e. the point at which the JVM and CLI versions have the samne features and are released on the same day) is 3.0, which is still one or two years away.

OK Programming language from USB stick with no installation

I'm looking for a compiler or interpreter for a language with basic math support and File IO which can be executed directly from a memorystick in either Linux or Windows. Built in functionality for basic datastructures and sorting/searching would be a plus.
(I've read about movable python, but it only supports windows)
Thank you
Not sure what are the issues there for the other languages, but I am pretty sure that Lua will work fine on such environment.
It is perfect for your requirements: basic I/O, math functions, excellent data structures (all based on numeric and associative array, with any kind of key/values, allowing the most complex operations).
Bonus: very simple to learn (for the bases, at least), readable, and powerful when you start to dig. And it starts to have a number of useful libraries, sockets, regexes and parsers, GUI, etc.
It is just a single binary file, no install at all, no registry access, no file access (beyond reading the binary and script!) if not requested, totally transparent: it is often used in embedded system, often memory constrained, on Roms, etc.
There is a python distribution called Movable Python which is designed to do exactly that. It might do what you want. Also, MinGW/MSYS will run on Windows with no registry entries or other installation beyond placing the files in a directory tree - all you need to do is set up the relevant directories in the path, which can be done in a batch file.
The Java JDK easily fits on a stick, and does not require installation; You can install it to a PC first and then just copy the install directory to the stick. I presume you can do the same for the Linux JDK.
And there's a ton of good text editors that don't require installation.
Not sure if it still applies to current versions, but I have an ancient perl.exe (version 5.001, from 1994 or 1995) that still works perfectly fine as a no-installation single executable.
If you can tolerate TCL, it's hard to beat a tclkit
TCC (the Tiny C Compiler) is a full implementation of C in a really small package. You can even write shell scripts in C:
#!/usr/local/bin/tcc -run
#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
TCC is available for any Unix-like platform, and also for Windows.
I've done exactly that with Ruby. Worked well.
I'm way late for this party, but I thought I'd weigh in anyway.
I currently have a Windows-usable USB stick with the following installed on it (for Windows):
Languages
Java
Erlang
Fantom
Groovy
Haskell
jacl (JVM-based Tcl)
JavaFX
JRuby (JVM-based Ruby)
Jython (JVM-based Python)
NASM
nice
pnuts
Rexx
Scala
SISC (JVM-based Scheme)
Sleep
Tcl
Prolog
gawk (via GnuWin32 and MinGW/MSys)
jawk (JVM-based AWK)
ANTLR
Clojure
JBasic (JVM-based BASIC)
Tuprolog (JVM-based Prolog)
Rhino (JVM-based Javascript)
YASM
Lua
Kahlua (JVM-based Lua)
C (via GnuWin32 and MinGW/MSys)
C++ (via GnuWin32 and MinGW/MSys)
Fortran77 (via GnuWin32 and MinGW/MSys)
Ada (via GnuWin32 and MinGW/MSys)
Programming Tools
jEdit (JVM-based programmer's editor)
Ant (JVM-based build tool)
Maven 2 (JVM-based build tool)
vi (via GnuWin32 and MinGW/MSys)
Vim
CMake
gmake (via GnuWin32 and MinGW/MSys)
Leiningen
Subversion
Fossil
ANTLRworks
ctags/etags
Geek Toys
All SIMH emulators, with networking if available
Several operating systems, utilities, etc. for same
And a cast of dozens in key libraries, plus the Geronimo application server.
Yes, this is a single USB stick, and I probably missed an item here or there while making this list. It's amazing what you can run off of a USB stick these days.
http://smallbasic.sourceforge.net/
Runs anywhere (even mobiles) and has everything you need.
You could use DevCpp, it comes with Mingw 3.x or CodeLite (Mingw 4.x) for C/C++. For Pascal you can use DevPas, for Python web development try InstantDjango or better yet Web2py (very nice indeed!), for Ruby you have InstanRails, for Perl you got a complete enviroment (even a C compiler!) with StrawberryPerl. You could install cygwin on the USB drive. There are a lot more options out there. Interested in a LISP like portable/cross-platform and little language? Try newlisp (its a gem!). Also you could run almost anything (linux or windows based) on a portable VM under Portable VirtualBox/VMplayer or QEmu with a performance tax ;).
Why not C++? You can statically link in any external librarys assuming there lisence allows it, and you won't have any external dependencies.