#2663 Considering Fan for complex Web application

andrey Wed 6 Dec

Hi folks,

With 1.0.70 released I'm considering Fan as a potential language to develop huge enterprise web app. By "huge" I means dozen of man years to be committed.

I'm in early stages of planning tech stack, and looking for expert opinions from people who has experience building web apps with Fan. Personally, I had great experience with Fan in the past, now in 2017 is there any advantages in using Fan for web app development comparing to TypeScript? (I've no experience with TypeScript)

I'd be happy to learn details from anyone who can suggest Fan to be used for web app over other solutions. I do not care about non-functional aspects of development (like size of ecosystem, learning curve, etc), but I care about productivity of an engineer in the long term.

Thank you, Andrey

brian Wed 6 Dec

My thoughts...

I think probably the most important question is do you want (or do you care) about what server environment you use?

TypeScript would probably require using node.js as your server environment.

I personally still believe the Java VM is the best server environment. Its super robust, mature, and fast. It has native threading and lots of APIs. But it is memory heavy if you want to run lots of micro services. But if you don't want to use the JVM server side, then Fantom probably isn't a good fit - although we run JS and can run in Node.JS, we don't have all the server side bindings like file system access.

Fantom definitely was early pioneer in the one language for both server (JVM) and browser (JavaScript). I know a lot of other languages have followed that model and its now not as uncommon as 10 years ago. I don't know how portability works in other langs, but I know Fantom has really strong story that one code base works robustly the same b/w JVM and browser. We have a fairly huge code base that we use in both browser and JVM.

The stuff Andy has developed with domkit is pretty interesting for working client side. Its definitely working out to be a much better browser UI platform than the original fwt APIs.

andy Wed 6 Dec

Hey Andrey,

I assume this is specific to the web frontend work.

Its hard to compare languages and stacks directly -- in general I think it comes down to:

  1. Am I proficient with (and like) this lang/stack?
  2. Is this lang/stack a good fit my team (current and future)?
  3. Is this lang/stack actively maintained and supported?

I've built a few commercial webapps in Fantom, including one where the frontend was pure Fantom + domkit, and one where the front-end was a hybrid of HTML + Fantom/domkit. My takeaway: yes its very productive.

I think this primarily stems from:

  1. A unified language on both server and client, which enables code reuse and allows you to think consistently about problems
  2. The dom and domkit APIs which provide a good level of integration into the underlying DOM without getting in your way

There are alot of great JS solutions today -- including frameworks that are much more turn-key than domkit. But if you are looking for solution that unifies these two points then Fantom is definitely a great candidate.

Feel free to email me if you have a specific questions.

ahhatem Wed 6 Dec

Hi Audrey, Good luck with your app. First, I consider Fantom to be one of the best language I have ever seen and it is my personal favorite. But generally I wouldn't recommend it for a project in this size unless you are willing to invest in the development of the language and the frameworks yourself. Fantom has a small community and many libraries and frameworks are maintained by 1 developer. Very talented, devoted and very helpful, but very small number of devs who naturally cannot be guaranteed to keep supporting the libraries on the long term. So you have to be willing to jump in and support whatever. In addition, fantom lacks the amount of tooling and ecosystem I would rely on for a project this size. What if you came across a tricky problem 4 or 5 years from now... How can you guarantee that you will find someone to support... Finally, I still think Fantom is great but I wouldn't choose it for something that size.. The business risk is just way too high.

SlimerDude Fri 8 Dec

Hi Andrey,

Good to hear from you!

I had great experience with Fan(tom) in the past

With each release the Fantom compiler goes from strength to strength, and now in 1.0.70 it is more robust than ever. The JS compiler enhancements also generate more performant Javascript. As great as it was, any annoying niggles you may have experienced in the past have since been ironed out.

The language is stable, and now is an ideal time to focus on libraries, apps, and the ecosystem.

advantages in using Fan for web app development comparing to TypeScript?

As you compare Fantom to Typescript I'm guessing you're building a Single Page Application (SPA). In that case, for an example of a fully featured enterprise application, look no further than SkyFoundry's own SkySpark v3.0!

It has code editors, charting, view builders, dialogs, and tables - all wrapped up in an extensible framework. Brian and Andy are quite modest when it comes to their work, but SkySpark is a real testament to what Fantom is capable of.

If you've not yet seen SkySpark v3 then I'd ask for a demo, or join one of their Deep Dive presentations. You could even Skype me if you just wanted a quick overview!

expert opinions from people with experience of building web apps with Fan

I myself favour the more traditional web applications with server generated web pages (less to go wrong, and easier to test). This is what the BedSheet suite of libraries and templating languages is based upon. As pointed out, any sizable web app will have both server and client components. Experience has shown me that being able to make use of Fantom on both sides of the equitation, and using its built in serialisation to transfer data, does make things much simpler. (Not to say you can't accomplish the same with Node, Typescript, and JSON.)

I care about productivity of an engineer in the long term.

Then I would say it's less about the languages and frameworks and more about the your approach to application architecture. Large monolithic applications are the beasts of maintenance nightmares. The trick for long term happiness is being able to intelligently break the application down into discrete problem spaces.

For example, my commercial StackHub web application comprises of 10 pods for REST APIs, Stripe, AmazonS3, Database, and email integration, etc. (Backed by some 30 standard Alien-Factory pods.) This insular approach makes new feature implementation and bug fixing very manageable.

With this in mind, as long as you have a intelligent architect with a vision, productivity can be kept flowing in any language with any framework.

I admit I've not done much Typescript either, but dynamic languages by their nature (and I'm mainly pointing at Javascript here) can be bad for long term maintainability. (I've led a few Node and AngularJS projects.) Useful methods often return an object rather than a simple scalar. But because you're never certain what data an object holds, or what it does, you're beholden to accurate documentation - both for your own code as well as 3rd party libraries. And having to maintain up to date documention for your own code quickly becomes a maintenance burden in itself.

To me, Fantom's static typing with its unique method of type inference, combined with a concise core API, makes it my preferred choice for productivity, every time.

@ahhatem makes the valid point that the Fantom community is still quite small and so you will need to be:

willing to invest in the development of the language and the frameworks yourself

Given Xored's generous contribution of F4 to the community, I figure you already know this and I don't think it will put you off!

Note that the SkySpark community is growing quite well, and due to this I've noticed an increased interest in Fantom.

The other point @ahhatem makes against Fantom is probably the most valid one, and that is; finding proficient Fantom developers further down the line could be tricky. That is true, though I would also say that Fantom, with it's familiar syntax and simple API, can be easily picked up by any competent developer.

Anyway, technical details aside I'll finish with that from a personal point of view, it would be great to have you (and Xored?) back into Fantom!

Steve.

Login or Signup to reply.