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
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,234
  • 11
  • 15
2
votes
0 answers

coffeescript vs typescript vs JSX vs dart vs fantom

TypeScript website offer the following D3 example is there any comparison of the same D3 codes for the following languages available: CoffeeScript TypeScript JSX Dart Fantom It would be interested to see which one is really easier to use? Thank…
user977828
  • 7,259
  • 16
  • 66
  • 117
1
vote
1 answer

trace_call method for Fantom Opera

trace_call is a quite useful method for simulating transactions on blockchain: https://www.quicknode.com/docs/ethereum/trace_call But for some reason, all node providers support it only on Ethereum Mainnet and Polygon, rarely on Arbitrum and BSC. I…
1
vote
2 answers

How to generate genesis file for fantom-foundation repo?

I gonna to build my own blockchain network by using Fantom network source project. I can't know what content is there in fantom network genesis file. Is there any document for it?
Lovely
  • 306
  • 2
  • 12
1
vote
0 answers

Fantom testnet keeps disconnecting

Has anyone deployed any smart contracts onto Opera testnet - which endpoint did you use for your deploy? I'm having a hard time with this one because it fails after either one or several contracts in a series I'm deploying: FetchError: request to…
Vlad
  • 465
  • 7
  • 26
1
vote
0 answers

JVM crashes with EXCEPTION_ACCESS_VIOLATION ntdll.dll+0x1b96f

I am running a Java application, but randomly it crashes my JVM. I have gone through multiple articles on this problem, but not able to find how I can debug/fix issue. Java Version: java version "1.8.0_221" Java HotSpot(TM) 64-Bit Server VM (build…
Gaurav Jeswani
  • 4,410
  • 6
  • 26
  • 47
1
vote
2 answers

How to generate locally the documentation for an imported pod

The script buildwebdocs.fan generates the documentation for the distribution's pods, but not for the pods I did myself or imported. How can I generate the documentation locally for this pods?
fraya
  • 61
  • 4
1
vote
1 answer

Why Fantom compiler complains about a class that has a Func field?

I wrote a Fantom script that defines a bunch of classes. As I could run the script successfully, I decided to convert this into a proper Fantom project, but one of the classes cannot be compiled and the error message is: Expected expression, not…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

Redirect standard output and standard err when executing a method

I have a program that tests each method in a Test# subclass and outputs XML in JUnit's XML format. For instance: class ExampleTest : Test { Void testOne() { ... } } I want to execute the testOne method and capture the standard output and…
fraya
  • 61
  • 4
1
vote
0 answers

A Specific HighChart wont show up in my Phantomjs created PDF

I have a web page created in Fantom that displays many charts created in HighCharts and I am turning this page into a PDF successfully using a script I created in Phantomjs. The problem is that I have 4 HighCharts in total but the third HighChart…
nuccio
  • 316
  • 6
  • 17
1
vote
1 answer

How to capture Process output in Fantom?

How do I capture the stream that is being created for the Process? See the limited Fantom documentation for Process: http://fantom.org/doc/sys/Process class Ipconfig { Void main() { proc := Process() proc.command = Str["ipconfig"] …
nuccio
  • 316
  • 6
  • 17
1
vote
1 answer

Fantom ERROR: cannot load SWT library;

I am brand new to Fantom and the IDE F4. I am not sure why, but the IDE is throwing this error whenever I try to run a script. I am positive that I have the right path set up for the SWT…
nuccio
  • 316
  • 6
  • 17
1
vote
1 answer

How to enable Cross Origin Resource Sharing (CORS) in a Fantom / afBedSheet REST service?

I am developing a REST API with Fantom and afBedSheet. I need to allow cross-origin resource sharing so that I can call my RESTful services via AJAX from the UI which runs on a different web container on a different port. I am currently doing this…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

How can I model GeoJSON geometries in Fantom?

I started with this basic abstract class for Geometry: @Serializable abstract const class Geometry { const Str type new make( Str type, |This| f ) { this.type = type f(this) } } Then I extended this abstract class to…
LightDye
  • 1,234
  • 11
  • 15
1
vote
1 answer

How to refer to a row index in a Fancordion fixture table?

Using tables in Fancordion v1.0.4, how can I use the row index in a column command to validate its value. For example if my Fixture is: class MyFixture : FixtureTest { [Str:Obj?][] getCountries() { return [["code":"AU",…
LightDye
  • 1,234
  • 11
  • 15