There's nothing uploaded yet but so far I have some progress with the cobra compiler being able to find and use javac and java (in path), compiling and running (single file) Java modules and generating java source, compiling and running it for very (very) simple cobra source files.
- Code: Select all
# cobc0 -back-end:jvm -kif -v:2 020-var-decl.cobra
Cobra Command Line 0.8.0 post-release
Copyright (C) 2003-2011 by Cobra Language LLC.
OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
CLR Platform: .NET
CLR Version: 2.0.50727.3603
Current Directory: C:\home\hops\src\cobra\Tst\100-basics
Current Exe: C:\home\hops\src\cobra\wkspace\Source\cobra.exe
Option Dictionary:
reveal-internal-exceptions: true
color: true
back-end: 'jvm'
keep-intermediate-files: true
verbosity: 2
contracts: 'inline'
correct-source: Set<of String>['none']
debugging-tips: true
embed-run-time: false
include-asserts: true
include-nil-checks: true
include-tests: true
include-traces: true
native-compiler: 'auto'
number: 'decimal'
test-runner: 'Cobra.Lang.CobraCore.runAllTests'
testify-results: 'r-testify'
Paths:
020-var-decl.cobra
Phase: Binding Cobra run-time library
Referencing Cobra run-time
Adding reference to Cobra.Lang.dll
Phase: Reading libraries
Reading assembly: mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
at: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
at: C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll
Final assembly reference list:
0. Cobra.Lang.dll
Loading reference: Cobra.Lang.dll
Reading assembly: Cobra.Lang, Version=0.8.0.1, Culture=neutral, PublicKeyToken=null
at: C:\home\hops\src\cobra\wkspace\Source\Cobra.Lang.dll
Phase: Parsing source code
Parsing 020-var-decl.cobra
Phase: Binding use directives
Phase: Binding inheritance
Phase: Binding interface
Phase: Computing matching base members
Phase: Binding implementation
Phase: Identifying .main
Phase: Generating Java code
cobratype - void
System.Int32
cobratype - java.lang.Integer
System.Int32
AsExpr-sh(5454, didBindInh=false, didBindInt=false, didStartBindImp=true, didBindImp=true, token=Token(ID, 'x', 'x', ln 7, col 4, 020-var-decl.cobra), name=x, name=x, type=IntType-mi(5451, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, isSigned=true, size=32, 5451), definition=LocalVar-mi(14017, name=x, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didStartBindImp=true, didBindImp=true, token=Token(ID, 'x', 'x', ln 7, col 4, 020-var-decl.cobra), isTracked=true, isTracked=true, 14017), 5454)
x
Phase: Compiling Java code
Compiling generated code
Compiling to produce Test.class
compiler = javac.exe
compilerOptions = -d . -classpath "C:\home\hops\src\cobra\wkspace\Source\CobraLang.jar"
nativeArgs =
outName = Test.class
baseExeFileName = test.Test
javaFileNameList = ['Test.java']
javac.exe -d . -classpath "C:\home\hops\src\cobra\wkspace\Source\CobraLang.jar" "Test.java"
Keeping intermediate files.
Phase: Checking if a default number type should be suggested
Running: test.Test
-------------------------------------------------------------------------------
stub:running all tests...
#
My initial target for this is to be able to compile and execute the tests in 100-basics ( so far I'm up to 025-assign-in-expr.cobra),
fleshing out at least minimal support for java codegen for the major (and obvious) cobra statements and expressions and to
eventually generate stand alone application jar files (currently just generate and run class files).
Its a bit messy since its a cross compilation environment from .Net using .Net libs and has no cobra compiled java RTL but thats the bootstrap path till I get something more java self hosting or hit a snag
I want to get a bit further with more things supported and tests working but hope to provide an initial patch soon.
Currently I'm working on Windows (XP) so the initial work will be (perhaps) specific to that
More as I get to it.