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.)
62 questions
1
vote
1 answer

Why FancordionRunner suiteSetup is not being called?

I am following MyFancordionRunner example from Fancordion v1.0.4 official documentation to test a BedSheet application, but the suiteSetup method (see below) is not being called and the server remains null, causing the fixture tests to fail with a…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

Custom FancordionRunner does not compile. What's wrong?

I am trying to compile a FancordionRunner modeled after MyFancordionRunner from the official Fancordion user guide, however, the compiler throws this error... /data/code/mypod/test/specs/WebFancordionRunner.fan(9,35): Invalid args make(), not…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

How to extend a Fantom class that implements a serialisation constructor?

A powerful feature of Fantom programming language is the it-block constructor, often used in serializable classes. Unfortunately I cannot find documentation detailed enough to do what I though should be pretty simple: Extending a class that declares…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

what's the fanws cookie?

I wrote a simple site using BedSheet to test adding cookies. When I ran the code and inspected the cookies using firebug, I found a extra cookie I didn't add named fanws (with value 06e3d816-7626-7b00-205a-0013e8a56e9d-dbc9c6c8fa03cfa4). Here is my…
elyashiv
  • 3,623
  • 2
  • 29
  • 52
1
vote
1 answer

How to verify a RESTful service that returns a HTTP 404, using Fancordion?

I'm writing a RESTful API in Fantom programming language. I'm using Fancordion to write the acceptance tests and have this scenario: Country.fandoc Country by Code ############### Passing a country code as a parameter to the Country RESTful service…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

How to unit-test a Fantom DAO class that uses AlienFactory's afIoc and afMorphia frameworks?

Say I have a simple Fantom app to retrieve data from a MongoDB database. The app uses afIoc (AlienFactory's IoC framework) and afMorphia (AlienFactory's MongoDB framework). I have a simple Entity called Foo and a DAO class (FooDao) to retrieve Foo…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

What is the criteria to choose between IocService and RegistryBuilder in Fantom afIoc

The documentation of Alien Factory's IoC framework for Fantom says: You can use IocService to start IoC as a Fantom service: IocService([MyModule#]).start ... reg := ((IocService) Service.find(IocService#)).registry service :=…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

PUT Request not happening at all in Fantom

I am having some trouble with PUT requests to the google sheets api. I have this code spreadsheet_inputer := WebClient(`$google_sheet_URI_cells/R3C6?access_token=$accesstoken`) xml_test := XDoc{ XElem("entry") { …
clive alton
  • 131
  • 1
  • 8
1
vote
1 answer

Making a POST request to OAuth 2.0 in Fantom

I am having a huge amount of trouble with this one simple POST request. Here is my code: monGoose := WebClient(`https://accounts.google.com/o/oauth2/token/`) monGoose.postForm(["code":mongoosetoken_string, "redirect_uri":redirect_string,…
clive alton
  • 131
  • 1
  • 8
1
vote
0 answers

Importing files into my java path

I'm writing a web app in Fantom using the F4 IDE and I want to integrate some of google calendars features into the app. I see some videos of how to use the google api in Eclipse, but I can't get that method to work in F4. Can anybody enlighten me…
clive alton
  • 131
  • 1
  • 8
1
vote
1 answer

Fantom loging to a remote web in code

Hi I'm really new to Fantom and I'm trying to do a few of things. I desire to access a data response in a server with a uri. Void gets(){ str := WebClient(webpage).getStr } But when I try to connect I revie a 401 error. What's the best way for to…
Francesc Clopes
  • 353
  • 1
  • 7
  • 19
1
vote
1 answer

What should be the lifecycle of afMongo's MongoClient?

Based on the afMongo example I'm currently doing this: mongoClient := MongoClient(ActorPool(), `mongodb://localhost:27017`) collection := mongoClient.db("mydb").collection("mycollection") ... // inserts or queries here ... mongoClient.shutdown My…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

Is it possible to mock afMongo's MongoClient or ConnectionManager?

I am using afMongo for accessing a Mongo DB from a Fantom web app and I'm wondering if it is possible to mock the MongoClient or the ConnectionManager so that the Test classes don't need a Mongo DB running.
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

Is there a cleaner way to iterate through Mongo query results in Fantom?

I'm writing a web app in Fantom language and using afMongo to access a Mongo DB instance. Following the example in afMongo documentation I get the results of a query that I need to iterate through. In a simplified example, the iteration looks like…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

Why afBedSheet don't see my types?

I'm running a BedSheet application but when I make a HTTP request to a particular route, I get this error in the browser 500 - Internal Server Error afBeanUtils::TypeNotFoundErr - Could not find match for Type mypod::MyClass. Available…
LightDye
  • 1,234
  • 11
  • 15