Fabric Smart Contracts in Kotlin - hyperledger-fabric

We are looking at building smart contracts in Kotlin language, even though its not officially a supported language. The reasons are -
It compiles down to Java bytecode.. So from a JVM point of view, its no different to java
Its a very expressive language with a much better type system than java.
Its got first hand support for functional programming constructs.
So, the question I have is not about technical feasibility - coz I know its not a problem. The question is, does anyone see any other issues with this approach? Perhaps anything core to Hyperledger Fabric which might cause issues further down the line? Also, curious if anyone else has tried this before in a production set up? Thanks

I don't know if anyone has used it in production, and/or hit any problems using Kotlin, but there is a Kotlin example in the Java chaincode repository.

Related

Is it possible to make a Squeak VM embedded in C without any plugins?

I want to use Smalltalk as an embedded DSL engine in C. No plugins required, and whole custom environment will be made by me. So almost ObjectEngine will be remained. Is this possible? I'm currently trying, however any help will be appreciated.
-- edit --
Any of Smalltalk implementation embedding guidance will also be appreciated. (except GNU Smalltalk. Because of it's license...)
This is a difficult thing to do with Pharo/Squeak:
The object engine depends on many primitives and thus many plugins need to be present. A while back most plugins couldn't be compiled statically. I don't know if this is still the case?
Building a whole custom environment is tricky, because it most likely means to strip down an existing image. There are various projects that try to build the infrastructure to bootstrap new images, but I haven't seen working solutions yet.
As Davorin writes Dolphin Smalltalk can be deployed as DLL. Similarly this is possible with Cincom Smalltalk and Smalltalk/X. All these Smalltalk's are commercial though.
To summarize, you are probably better off looking at Lua or Python that have been applied in your context many times already.
There was once a proposal for GSoC but never done:
Packaging Squeak as a DLL
A conventional approach to making libraries written in a particular language available to other languages is to package a library as a dynamic load library or shared object (dll from here on in). Adapting that approach to Squeak would both allow use of Smalltalk code by a wider audience and enable alternative deployment approaches for Squeak applications, easing the creation of Squeak plug-ins for systems like Apache, web browsers and so on. There are broadly two different approaches one can take, which one could call passive or active. In the passive architecture, the Squeak dll is inactive until called from another language, and runs only until a result is answered to the caller. In the active architecture the act of loading the dll causes Squeak to start up on its own thread and accept incoming calls from other threads in a form of rendezvous. The passive approach is easier to build but less useful; one does not have the full range of Squeak facilities such as light-weight processes, delays etc.
The objective of the project would be to implement either the passive or the active approach, depending on the student's interest and ability. The goal is to make Squeak more broadly useful to users and application deployers alike. There are many technical challenges to be met that will involve both Smalltalk and C coding and the use of the Smalltalk-C hybrid language Slang in which the Squeak VM is written.
The benefits to the student include gaining an in-depth understanding of dlls, interfacing to dynamic languages, foreign function interfaces and of the Squeak VM. The student will also be gaining an understanding of architectural issues by considering the many trade-offs between the passive and active approaches.
The benefits to the Squeak community will be in being able to package and deploy Squeak applications much more broadly than before.
Dolphin Smalltalk from Object Arts can be deployed as dll. But you would need to check the license for your particular use case, and it is windows only.

Java Security Manager for JRuby

I'm allowing user supplied ruby code to run in server(java scripting), and since jruby doesn't support safe-levels as in ruby I'm thinking about using java's security manager.
Is this a good decision? Has anyone else implemented this? Are there any good articles/books/resources that introduce me to security manager?
This sounds like a perfectly reasonable decision.
The article Java Scripting and JRuby Examples demonstrates using JRuby with the SecurityManager, so at least one other person was able to successfully implement this configuration.

Can Gobby/Sobby be used for collaborative edition for a team of developers?

Gobby/Sobby is an open source client/server for collaborative edition of plain text file (source code).
My question is 4-fold :
Can you share any real-life usage of Gobby/Sobby for development among a group of physically separated developers ?
Is the project mature enough as a productivity tool ?
What are the working use cases ?
What versions should be used ? (It seems 'undo' feature is not yet officially packaged)
Thanks
Jerome
Yes
Mostly, you encounter issues running Windows clients (random crashes). Find a version that works and stick to it.
I recently started using it with the team I manage. It has definitely increased my productivity when reviewing code, implementation collaboration, and answering general questions. It's great for those "hey, can you take a quick look a this?" questions.
We have only used development release 0.4.93.

Resources To Build a Framework

I'm thinking in create a framework, a little project with my friends, just to loose some time trying to build something, but we don't know where and how to start, then we are needing to know two things:
Which languages is possible to do this?
Where we can found some resources to begin(tutorials, sources...)?
All types of help are very welcome. Thanks.
You can use any language (that provides a mechanism for creating libraries) to build a framework.
Learn the language and development platform of choice, first. Creating a framework is just creating a library that provides a useful foundation for people.
Just trying to "Set out to build a framework" is probably not going to be too successful, however. Typically, a successful project, especially one being done for fun, is one that fills some need... Think about what you are developing, or what you want to develop. Create a project that is exciting, fun, and useful for you.
If, in the process, your project gets large, you can always pull out the building blocks and turn it into a framework for other people to use, as well.
You can create a framework in just about any language in existence, with a few common sense exceptions (such as a web server in Javascript). The most important thing to remember is that in order to make code reusable, you have to first make it usable. Your framework really has to make something simpler than doing it the original way.
Just curious, what kind of framework are you thinking about making?
If you don't know where to start, what to do or how to do it, why not join an open source project of your liking? It'll be a great starting point. You'll have the chance to observe how to design frameworks, what are the challenges, practices for writing code, and answer a lot of other questions along the way.
Then, when you'll have a concrete idea about building something, you'll already have a lot of useful knowledge on how to make it successful.

multi platform languages on the rise (desktop)? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 13 years ago.
I am currently working in a .Net project but from university I have also a good background in Java. Recently I am asking myself, if multi plattform languages (like Java, or VM based like Scala) aren't on the rise?
Lets have a look at Suns WORA write once, run anywhere principle, which had been rephrased to write once, TEST everywhere because in the past especially desktop applications were/are still a Windows domain. But the last years there were quite some changes like
Linux has improved hugely in driver support and usabilty
Mac OS is getting even more popular
native look & feel thanks to SWT/JFace for Java
Rich Client Frameworks (RCP and Netbeans) that save a lot of time and provide rich experience
So, creating applications targeted on multi plattforms should be a reasonable way to go. For example, why should a small/mid-sized company pay a lot of money for windows/mac when it can use Linux (honestly, when you are not a gamer you dont need windows ;) ). And of couse then those companies would prefer software that runs on their machines (maybe the CEO a has MAC because he can afford it but needs the same apps.) Eclipse RCP can provide for example and then it really is WORA.
I like working on C# right now, but in 1-2 years when I want to have my own little company I will use Linux and the development will probably focus on what I've just written. I just wanted to know what others are thinking (maybe I change my mind).
Please don't start a war on Linux vs. Windows vs Mac (I use the first two). Its only about if multi-plattform is a good way for the future, or if you gain more by the advantages of a single platform (special features).
I work for a Qt consultancy company that's been writing multiplatform applications for a few years and I work on KDE's port to OSX and previously at a company providing a client for Windows/Linux/Mac.
The obvious benefits you get from supporting multiple platforms are:
Goodwill from niche communities (including blogging, word of mouth support)
Your developers can work on whatever platform they like so you can recruit them more easily
Your application will probably be slightly less buggy as you'll be testing on multiple platforms
The downsides:
Packaging/distribution/support becomes a big of a pain
Some platforms can get easily neglected
You don't tend to hook into the backend features of the OS as well
If writing a GUI application then you tend to end up with something that doesn't really meet the HIG of any platform unless you have quite a lot of platform-specific tweaking or have a toolkit that helps with this (e.g. Qt)
I still think it's worthwhile and agree with you that it's the future of applications. Really, there is enough good, high-level technologies that there's no need to limit your market to a single platform's users and Linux is a huge in emerging markets so being able to run your application there will be more and more important as time goes on.
Cross-platform solutions I've seen used to good effect:
Adobe Air
C# (with .NET or Mono)
Qt
Java
Web applications (obviously)
Yes, this is happening, but it's a very slow process.
You can trace the trend back to the UCSD Pascal P-system from the early 80's. In the 90's we got the JVM, and in the naughties we got the CLR. These newer VMs each support many languages from third parties. Python, for example, has long had its own VM, but also comes in a version that runs on the JVM, called Jython, and another one that runs on .NET's CLR, called Iron Python.
Other VMs exist that are targeted by multiple languages. The Parrot VM was created initially for Python and Perl 6. The Reia language runs on Erlang's BEAM VM. I'm sure there are other examples.
On top of that, there are many languages that have been cross-platform for a decade or two, like Smalltalk, early versions of Perl, Ruby, etc.
This is all a kind of long-term tectonic shift. It's driven by the fact that computers are getting faster, while many tasks we use computers for don't need to get faster. So, we can use high-level languages to write programs to do these tasks, where it wouldn't have made sense in the past. In the early 80s, the successful new word processors were written in assembly language. In the 90s's, C. Today, Javascript.
Check out mono http://www.mono-project.com/Main_Page if you like C#
Use SWT (http://www.eclipse.org/swt/) if you prefer java
YMMV
If you are going to spend hundreds of thousands (or millions) of dollars developing an application, it makes sense for it to be capable of running on as many machines as possible. Just a few years ago, platforms had many platform-sepcific features, but that distinction is rapidly disappearing with the availability of cross-platform compilers like Mono.
All depends of the activity domain of the software that you develop...
If end users are or plan to use multi-pateform so you must care about it ! If not, you can develop on the plateform used by your customers !
Of course, some peope would say : even if all customers are on Windows, the development is more productive on MacOS... but it's an other question !
In general, your users will generally prefer an app that looks and behaves like a native application. Many of the cross-platform frameworks are really very good at emulating the native look and feel. Just be aware that if your app doesn't feel native (maybe through some quirk in your toolkit of choice), critics will beat you over the head about it forever.
Also, The issue of using cross-platform toolkits really depends on the application domain you're targeting. For example, if you're working with video, creating a cross-platform app with a good user experience is very, very challenging. On the other hand, CRUD (Create-Update-Delete) apps commonly used inside of enterprises are excellent candidates for developing with cross-platform languages/toolkits.
Also, one reason that Java is very popular for applications deployed inside of enterprises is the ease with which you can deploy updates (via Java Web Start - I think C# has a similar update technology too). However, once you step outside of the walls of the business most users will shy away from Java Web Start apps.

Resources