Extending squeak or pharo - smalltalk

Using Monticello package manager does not seem to guarantee that, once you added the interesting package(s), the total image is still coherent. Are there any ways to verify that? Are dependencies verified? Are there guidelines in that direction?

I think you're looking for Metacello, a package and configuration manager for Monticello.
You can check out this guide: Managing projects with Metacello, and also there's a page on Google code

While Monticello actually has the possibility to ensure that dependencies are met,
it is limited to the form “this Monticello version depends on exactly these other Monticello versions”. Also, specifying these dependencies is a bit hidden in the Monticello browser and, above all, scarcely used in the community.
As Uko said, Metacello is exactly intended to solve the problem of dependency management in Smalltalk systems. It is not limited to Monticello, conceptually. To my knowledge, most GemStone, Pharo, and Squeak images come with Metacello pre-installed or easily installable.
Have a look at the blog of Metacello’s author, Dale Henrichs, where he gives some introduction to using Metacello.
There is also the Metacello Repository, where most configurations (think software receipts) can be found.

Monticello's responsibility ends with loading individual packages. Coherence comes with either Metacello (see Uko's answer) or with SqueakMap.
SqueakMap stores install scripts that ensure that entire applications get loaded into your image.

Related

How to install TinkerPop

I have just recently come across graph databases and Tinkerpop.
I am somewhat confused on how/what to install to use Tinkerpop 2.5.0/2.6.0. Does it have to be installed on each Database separately (as you would a plugin) or can I set it up and then use it to access different supported software.
My goal is to use it to try out 2 (possibly more) different databases (mainly Neo4j and OrientDB or perhaps Titan) and be able to query them using Gremlin.
How you use TinkerPop is entirely dependent on what you intend to do with it. If you are just getting started, I suggest you simply download the Gremlin distribution, unpackage it and start the console with bin/gremlin.sh. Working in the REPL will help you learn quickly as the feedback time for trying things out is basically instantaneous. Even as your Gremlin code makes its way to production, you will find the Gremlin Console to be a good friend as it provides a way to try out ideas before committing them to code. It also provides a mechanism for maintaining/administering your database with Gremlin.
If you intend to use TinkerPop in a JVM-based application then you will want to use a dependency management tool like Maven and reference the appropriate TinkerPop dependencies you'd like to use. Alternatively, I suppose you could try to manually manage the dependencies by downloading them individually from Maven Central and adding them to your path (though I wouldn't recommend that for obvious reasons). I guess my point for suggesting that, is to just make it clear that the TinkerPop library is just a set of jars that can be included in your JVM development tools like any other.
How you work with a particular database is dependent on the one that you choose, but again the process is little different than what I described above. Neo4j is packaged with the Gremlin Console, so you can work with it right away in there. For OrientDB, you will want to copy those dependencies into the Gremlin Console path (i.e. the /lib directory). If you are building an application, then maven is again your friend and you simply reference the Neo4j or OrientDB maven coordinates and all require dependencies will come with it.
Some implementations, like Titan, have separate prerequisites (e.g. install cassandra or hbase). In those cases, you will need to refer to their documentation for specifics on how to set them up.
All that said, if you are just getting started, I recommend that you look into TinkerPop3. It is the next major line of development for TinkerPop and quit different from it's previous incarnations. It does not yet have all the of the implementations in play as of yet, but database vendors are at work to bring them online. All that I wrote about TinkerPop 2.x "installation" above generally applies to TinkerPop3, however, the TinkerPop3 Gremlin Console does have a plugin system that can help make it a little easier to bring in external dependencies, preventing you from having to worry about dealing with them manually.

What is the difference between Lazarus and CodeTyphon

Firstly, I saw some topics about these two but weren't my answer.
I'm looking for a good FPC(Free Pascal Compiler) IDE on GNU/Linux.
There are some IDE's like Lazarus and CodeTyphon. I need suggestion to choose one of those.
I've tried Lazarus once but all windows was separated. It looks messy and not interesting.
I would like to know what are the distinguishes between these two ?
I would like to know advantages / disadvantages each of those. Thank you
CodeTyphon is a distro of Lazarus, like Ubuntu and Debian are distros of Linux.
CodeTyphon comes with a large package of components and plugins, that otherwise you would have to google and download and install.
CodeTyphon have their own idea what are stable versions and what are not stable yet for both of FPC (compiler) and Lazarus(IDE). Whether their assessment is better or worse than upstream's Lazarus Team's, I don't know.
What about one-single-window plugin, it is work-in-progress and it doesn't seems to me it is ready for production use, no matter would you get it as part of CT or download and add it to vanilla Lazarus. However maybe it better works on Linux than on Windows, I don't know.
There were however issues with code legality in CT grande bundle. It is widely believed that Orca (if I remember the name) violates copyrights of glScene/vgScene, which also happened in early Delphi FMX releases but was fixed by EMBA later. There also were disputes in FPC forums/wiki about CodeTyphon pirating some open-source components. See answer by Peter Dunne below.
Your question is akin to asking the difference between Linux and Ubuntu. Lazarus is an IDE/component library, based on FreePascal (FPC). And CodeTyphon is a distribution of Lazarus and FPC. So CodeTyphon is just one way to install a functioning installation of Lazarus.
Lazarus uses the same floating window design as older versions of Delphi. Installing from CodeTyphon won't change that.
Myself and several friends highlighted several licensing issues with codetyphon
most of which could have been corrected by sourcing the included files from known good source and ensuring the correct license headers were included
PirateLogic refused to correct the issues which means they are using code in direct violation of the original license terms
The fact its open source code does not change the fact they are pirating the code by not including the correct license even after the issue was highlighted
I also found several instances of copyright code included which appears to be proprietary and not FOSS at all
They also changed the path & file names on some libraries so that source is no longer compatible with standard lazarus/component installs
This in my view is totally illogical
These 2 factors heavily undermine what was potentially the best FPC/Lazarus distro
Hardly professional
Lazarus can be a daunting installation process due to it's nature as a cross compiling environment. You don't just download an installer and click ok. A typical "installation" is actually a bootstrap FPC compiler doing a three-pass compilation of an "install". There are plenty of good installation scripts/methods from the official Lazarus/FPC team and in the community for a . But, understandably, the installation process is a skill in itself.
CodeTyphon is a a different/separate branch of an installer system, which is more of a utility suite/tools/third party code compilation library. If you want the simplest installation experience go with CodeTyphon. It has the nice graphical front end for managing the compiler. You can conveniently do the fancy stuff like build "cross-compilers" for almost every "target" operating system out there. It also is jam packed with hundreds of the best components/libraries pre-installed. It is a very actively maintained project and very professional. A whole lot of work is done for you.
Even if you want to be learn the low level compiler capabilities, CodeTyphon is a good place to start. It is written in FCP/Lazarus and is open source. Simply study it as "working demo app" and the other info on the compiler details. If you crash it, at least you don't have to learn to climb the hill. You get to get to start from the top and lose control on the way down. Start from scratch (and a three hour reinstallation) Hahaha
Lazarus also has a package "AnchorDock" which allows you to dock all the windows into one. Either install the anchor dock design package after installing Lazarus, or install Lazarus using the script at getlazarus.org which will do it for you.

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.

Pharo Gofer, can it fallback to local package cache when offline?

Can I tell Gofer to fall back to the local package cache when no internet is available?
For example such that I can use
Gofer it
squeaksource: 'CodePhoo';
addPackage: 'CodePhoo';
load
to setup an image when offline on the train? (In that case we can be sure that the packages are in fact available locally from a previous image setup.)
Theoretically yes, the model of Gofer would support such things.
Practically no, because of missing support from the Monticello side.
Even though Monticello provides a MCRepositoryGroup, this code unfortunately throws all kinds of different errors when one of the repositories is not reachable. That probably makes sense in the context of the Monticello tools, but for Gofer that would need to be reimplemented.

Should we store JRE in CVS/SVN?

I want to bundle JRE 6.0 together with my java application. All my source code reside in CVS. My client will check-out the code and build it themselves. Should I store JRE in CVS?
I normally advocate putting most everything in source control, but this seems a little excessive. Why ?
the JRE is readily available from http://java.sun.com
it doesn't change that often. I'd expect you to specify a minimum version for your code to run against (e.g. 1.5, 1.6 etc.)
I would not put a JDK or JRE into a source code repository:
It is bad practice to put externally versioned things into your version control because it usually leads to over-constraining, obscuring and/or hard-wiring your app's external dependencies. (Maven or Ivy are good solutions for dealing with external dependencies, though not in this case,)
Putting binaries into version control is a bad idea for some version control systems.
But I think your real problem (actually, your user's organization's problem) is the IT folks who refuse to contemplate upgrading the JRE:
They need to be made aware of the
fact that they can install multiple
JRE versions on the one machine, and
configure apps to launch with the JRE
version they require. (It is trivial
on Linux ...)
They need to be made aware of the fact
that their policy is an impediment to
progress.
They need to be made aware of the fact
that their policy is a potential security
issue. If they force users to deploy their
own copies of JDKs / JREs in random places,
it will be difficult to ensure that JRE security
patches get applied. (Besides, 1.4.2 is due
to be end-of-life'd soonish, and security
patches for it will cease.)
EDIT: and there is also the legal question of whether "redistributing" a JRE out of your source code repository is a violation of Sun's click-through JRE/JDK download license. (I don't know ...)
As best practice, you shouldn't keep any binary files in the source control system. For Java developers there is maven that does it's work better in versioning jar files. The reason is that we want to keep our source repository as small as possible so it is faster for those that checks out our code for the first time.
But if you still want to keep binary files in the source control, it would be best to avoid using CVS, because CVS is bad in versioning binary files. You can search with google, why it is bad. If you use SVN, then it still okay because SVN handles binary files much better than CVS.
I see nothing wrong with storing the JRE in CVS.
However, it's not so important whether you do or not as long as your script can pull it as part of the build. For example, if you want to host a downloadable jre.zip on an HTTP server, or point to it in a Maven repo, that's just as good.
Well won't your client all ready have the JRE if you expect him to compile the code before running it? The JDK contains the JRE.
Depends a lot on what you use to handle dependencies. If you use Maven, then create a maven package with the stuff you need, and host it on a local repository.
If you just have CVS (like we do) then it is fine to create big binary packages (since you will need them) which you can then put in CVS. Just be aware that they should be static for best CVS performance.
ALso note that the jsmooth package can create an EXE file of your jar with an JRE embedded in it. This might solve your deployment problem.
For remote compilation, Eclipse can work with a plain JRE. You just need to tell Eclipse where JRE you already have prepared above is located on the disk. There is also a folder inside the Eclipse distribution where the launcher looks automatically.
I'm wondering about the client building the application themselves. It will require some kind of Java compiler, most probably javac wich is part of the JDK. So your client will not only need a JRE, but a JDK as well (unless they will be using Jikes or another alternative compiler).
javac is capable of generating bytecode for previous versions of Java, so using a newer compiler should not pose any problems.
Personally, I would not include large binaries like a JRE as part of my own repository. The JRE can be considered very stable and just listing the minimum version required should be enough. Installing a JRE is also something quite different than installing a single Java application. The two activities should not be mixed.