J.A.V.A.

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
This is still a work in progress. It may be changed in the future.

J.A.V.A. or Just Another Verbose Annoyance is a WIP joke language by Tailcalled. It is an object disoriented language.

Classes

Everything in J.A.V.A. is about classes. If you want to create a class, you have to get a class factory, which you can get from a class factory provider. The only implementation of that is ClassFactoryProviderSingleton, which contains a static singleton instance. This is how you create a simple class in J.A.V.A:

   ClassFactory factory = ClassFactoryProviderSingleton.getSingleton().getFactory(ClassFactoryProvider.CLASS);
   factory.setName("Hello, World!");
   MethodFactory methods = factory.createMethodFactory();;
   Method main = methods.createMethod("main");;;
   StatementBuilder statements = main.createStatementBuilder();;;;
   Statement statement0 = statements.createStatement(0);;;;;
   ExpressionBuilder expressions = statement0.getExpressionBuilder();;;;;;
   Expression helloWorldString = expressions.stringLiteral("Hello, World!").build();;;;;;;
   Expression printHelloWorld = expressions.clear().call("println").on(helloWorldString).build();;;;;;;;
   statement0.set(printHelloWorld).ignoreResult().save();;;;;;;;;
   Statement statement1 = statements.createStatement(1);;;;;;;;;;
   expressions = statement1.getExpressionBuilder();;;;;;;;;;;
   Expression return = expressions.return().from().method().with(expressions.nullLiteral.build());;;;;;;;;;;;
   statement1.set(return).ignoreResult().save();;;;;;;;;;;;;
   statements.updateStatement(0).set(statement0).save();;;;;;;;;;;;;;
   statements.updateStatement(1).set(statement1).save();;;;;;;;;;;;;;;
   main.updateStatements.set(statements).save();;;;;;;;;;;;;;;;
   factory.addMethod(main);;;;;;;;;;;;;;;;;
   factory.build().main();;;;;;;;;;;;;;;;;;

This program prints 'Hello world'. Some might say it's over-engineering, but we say that it's very maintainable, unlike the haskell equivalent:

   main = print "Hello world"

Semicolons

The number of semicolons after statement n must be n.