Questions tagged [fantom]

The Fantom Programming Language

Introduction

A blurb from the Fantom home page:

Fantom is designed as a practical programming language to make it easy and fun to get real work done. It is not an academic language to explore bleeding edge theories, but based on solid real world experience. During its design we set out to solve what we perceived were some real problems with Java and C#. Our background is heavily Java, but many of Java's problems are shared by C# and .NET also.

So what is it?

Design goals for and capabilities of the language include:

Portability

Write code portable to the Java VM, .NET CLR, and JavaScript in the browser.

Familiar Syntax

Java and C# programmers will feel at home with Fantom's evolutionary syntax.

Mixins

Interfaces but with implementation.

Concurrency

Tackle concurrency with built-in immutability and actor model.

Object Oriented

Everything subclasses from Obj. Value types when you need the performance.

Functional

Functions and closures are baked in.

Static and Dynamic Typing

Don't like the extremes - take the middle of the road.

Serialization

Built-in "JSON like" serialization syntax makes Fantom ideal for declarative programming too.

Elegant APIs

We're quite obsessive about providing all the key features required for a standard library, but with much less surface area than the APIs found in Java or .NET.

REST

URI literals and a unified namespace of resources identified with URIs.

...and a host of thousands.

There's lots of information about Fantom available out there.

Documentation

Learning more about Fantom is a click away.

Community

  • There's a consolidated blog list with entries ranging from discussion about the language to announcements of releases.
  • There's a ticket system for reporting and reviewing bugs, feature requests, etc. (It also serves to demonstrate the responsiveness of the creators.)
  • There's a discussion board for sharing opinions, tips, complaints, etc.
  • There's an IRC channel with helpful people. (It can be a bit slow. Be patient.)
56 questions
13
votes
5 answers

First impressions of the Fantom programming language?

Has anyone here given the Fantom programming language a whirl? (pun intended). My first impression: I like the ability to have the code run on either the .NET or Java VM. The syntax is nice and clean and does not try anything fancy. I have a belief…
Swaroop C H
  • 16,522
  • 10
  • 41
  • 49
6
votes
2 answers

How to unzip files in a Heroku Buildpack

I'm writing a custom Heroku buildpack (heroku-buildpack-fantom) for Fantom, and as part of the compile script I've downloaded a .zip file (from a language vendor), but how do I unzip it? unzip is not a recognised command. gunzip exists but I can't…
Steve Eynon
  • 4,308
  • 1
  • 23
  • 44
4
votes
1 answer

Compile a Fantom project into a jar when it references java source code?

I have a Fantom project that uses some native java files, and can successfully compile into a pod. However, I'm trying to compile it into a jar file instead to make it more portable for other users. I've been trying to use the JarDist tool, but it…
Cain
  • 234
  • 1
  • 7
4
votes
1 answer

Running afBedSheet sample produces "Service does not exist for Type 'afIocConfig::FactoryDefaults'" error

I'm trying to create a new web application in Fantom programming language using the afBedSheet framework but can't get the simplest example to run. The code is: using afBedSheet using afIoc class AppModule { @Contribute static Void…
LightDye
  • 1,174
  • 8
  • 14
3
votes
2 answers

Java equivalent of Fantom HMAC using SHA1

I'm having trouble doing the following in Java. Below is the Fantom code from the documentation for the the tool I am using. // compute salted hmac hmac := Buf().print("$username:$userSalt").hmac("SHA-1", password.toBuf).toBase64 // now compute…
LostHisMind
  • 338
  • 4
  • 16
3
votes
3 answers

is fantom generated bytecode as performant as java equivalent bytecode?

from the many jvm languages appearing nowdays, there's one that seems to be particularly appealing have a look at http://fantom.org/doc/docIntro/Tour.html I just wonder if, when ignoring the dynamic typing feature, the generated bytecode is…
opensas
  • 52,870
  • 69
  • 227
  • 340
3
votes
1 answer

Passing a Fantom type literal

I'm trying to dynamically cast an object in Fantom to the desired type chosen at runtime. Type type := Int# Obj n := 1 as Obj echo((n as type).toStr) This is a simplified example. I want to pass the type to a class and have it initialised when run.
candronikos
  • 129
  • 1
  • 9
2
votes
1 answer

Fantom fwt Combo widget seems to fire modify event on construction

I have written this Fantom class using gfx using fwt class Test { Window window := Window { size = Size( 400, 320 ) SashPane { Combo { items = Month.vals onModify.add( |e| { echo(…
LightDye
  • 1,174
  • 8
  • 14
2
votes
1 answer

Accessing Fantom class' members from a member function in a constructor it-block?

If I define this Fantom class const class Mixed { const Int whole const Int numerator const Int denominator const | -> Int[]| convertToFrac new make( |This| func ) { func( this ) } } And I want to create an instance defining the…
LightDye
  • 1,174
  • 8
  • 14
2
votes
4 answers

Why can't Fantom find the resource in a jar?

I've recently gotten started using Fantom. I've got a jar file that contains a resource (svg image, in this case). I can use the classes from the jar just fine, but the resource won't load:…
Jorn
  • 16,599
  • 15
  • 67
  • 103
2
votes
1 answer

Fan command from a Fantom process Failing

I am trying to call a fan command from a Fantom process. This is the error it runs from Fantom, it runs correctly from the command line. What do you think the problem could be? class Main { Void main() { buf := Buf() Process() { …
nuccio
  • 536
  • 4
  • 14
2
votes
1 answer

Auth Failed trying to connect from a Fantom script to a MongoDB hosted in MongoLab. What's wrong?

I'm trying to connect to a remote MongoDB v3.0.8 hosted in MongoLab using a Fantom v1.0.67 script. The driver I'm using is afMongo v1.0.4. The connection line is: mongoClient := MongoClient( ActorPool(), …
LightDye
  • 1,174
  • 8
  • 14
2
votes
1 answer

How can I solve this dependency issue between Fantom pods afBedNap, afBounce and afBedSheet?

I found an issue trying to install afBedNap. The process went... fanr install -r http://repo.status302.com/fanr/ afBedNap afBedNap [upgrade ] 0.0.18 => 0.0.20 afBedSheet [downgrade] 1.4.2 => 1.3.16 ... Installation successful (2 pods) Then…
LightDye
  • 1,174
  • 8
  • 14
2
votes
1 answer

How do I route to a directory?

I'm playing around with afBedSheet and wish to handle all requests to a directory. eg a request to /abcd calls abcdMethod#doSomething I have the routes set up as @Contribute { serviceId="Routes" } static Void contributeRoutes(OrderedConfig conf) { …
2
votes
1 answer

How can a custom filter be added to the HttpPipeline using afBedSheet?

The afBedSheet documentation says that "Filters can be used to address cross cutting concerns such as authorisation." and shows this code snippet: @Contribute { serviceType=HttpPipeline# } static Void contributeHttpPipeline(OrderedConfig conf,…
LightDye
  • 1,174
  • 8
  • 14
1
2 3 4