![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
functionalscript
Advanced tools
FunctionalScript is a pure functional programming language and a subset of ECMAScript/JavaScript. It's inspired by
Try FunctionalScript here.
Create a new FunctionalScript repository on GitHub here.
jsonFile = expression
expression = primitive | array | objects
primitive = 'true' | 'false' | 'null' | number | string
array = '[' (() | items) ']'
items = expression (() | ',' items)
object = '{' (() | properties) '}'
properties = propertyId ':' expression (() | ',' properties)
propertyId = string
This stage can be used as an intermediate-code for VMs.
fjsFile = expression
expression = primitive | array | object | func | id | propertyAccessor
func = ('()' | id) '=>' body
body = '{' statements 'return' expression ';' '}'
statements = () | (statement statements)
statement = decl | ifStatement
decl = `const` id `=` expression `;`
ifStatement = `if` `(` expression `)` body
propertyAccessor = expression `[` expression `]`
call = expression `(` ( expression | ()) `)`
nodeFile = statements 'module.exports' '=' expression ';'
expression = ... | 'undefined' | groupingOperator | binaryOperatorExpression | unaryOperator | conditionalOperator
groupingOperator = '(' expression ')'
binaryOperatorExpression = expression binaryOperator expression
binaryOperator = comparisonOperator | arithmeticOperator | bitwiseOperator | logicalOperators | '??'
comparisonBinaryOperator = '===' | '!==' | '>' | '<' | '>=' | '<='
arithmeticBinaryOperator = '+' | '-' | '*' | '/' | '%' | '**'
bitwiseBinaryOperator = '&' | '|' | '^' | '<<' | '>>' | '>>>'
logicalBinaryOperator = '&&' | '||'
unaryOperator = '-' | '~' | '!'
Note: the syntax should be fixed to reflect operator precedents.
No ==
, !=
, =...
operators.
func = ('()' | id) '=>' (('{' statements 'return' expression ';' '}') | expression)
propertyAccessor = expression (('[' expression ']') | ('.' id))
propertyId = string | id
For example 42n
.
typeOfOperator = 'typeof' expression
inOperator = expression 'in' expression
Hex, binary and octal literals
Functions with multiple parameters.
Spread syntax. For example ...object
.
Destructing assignments. For example const {a,b} = exp;
, const [a, b] = exp
.
Property Id expression { [exp]: exp }
.
Allow no semicolons.
Optional comma in arrays and objects.
Template literals const r= `onst r = ${exp}`;
.
An if
statement if (exp) { ... return exp }
Multiline strings
'sss\
wwww'
Regular expressions.
Typing using JSDoc and TypeScript types.
Mutable types with exclusive ownership (similar to Rust mutability).
let
, for
, while
etc.
Note: let
can work as an object name reuse.
In this case, let
objects can't be used in nested functions. It means we can't reference let
object.
let x = 5 // ok
f(x)
x = 'hello!' // ok
f(x)
const r = () => {
return x // compilation error
}
Translated into
const x0 = 5
f(x0)
const x1 = 'hello!'
f(x1)
function*(){ ... yield ... }
.async () => f(await exp())
.Controversial ideas:
import x from "..."
, export const x = ...
, export default =
e.t.c. This may break new Function
runners.FAQs
FunctionalScript is a functional subset of JavaScript
The npm package functionalscript receives a total of 126 weekly downloads. As such, functionalscript popularity was classified as not popular.
We found that functionalscript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.