From: Thiago A. <thi...@gm...> - 2005-07-15 02:40:21
|
Hello, The debugger prototype is available on a http-accessible darcs repo. I will keep this repo as up-to-date as possible and you will be able to get the patches for the debugger from there. I will probably start another repo for the 'real-debugger' just after I get confortable with the prototype and underlying concepts (either Eclipse or functional implementation related). So, the URL for the repo is http://www.cin.ufpe.br/~tbas/hdtdebugger/debuggerPrototype.repo/ And you can do a simple darcs get to get all the repo contents: $ darcs get http://www.cin.ufpe.br/~tbas/hdtdebugger/debuggerPrototype.repo= / Darcs will complain about one of the patches: the one that moves the test code from the parser plugin to a parser test project. But this isn't a real issue, the only problem is your parser plugin will have more code than necessary and will also depend on the junit plugin. And yes, I am working on fixing it. The prototype is scattered in three plugins: 1. net.sf.eclipsefp.haskell.core.fullparser: Contains the Core Language parser (I agree fullparser wasn't the best name someone could have given to a very restricted parser) 2. net.sf.eclipsefp.haskell.debug.core: The headless debugger core 3. net.sf.eclipsefp.haskell.debug.ui: The user interface specifics for the debugger It was developed using Java 5.0 and JavaCC 3.2 and you will need both tools to compile the source code. All the code should be built after importing the projects into the Eclipse IDE (sure there is another way, but I still didn't test it) and generating the .java files from the parser grammar file (.jj). So, the process for using the plugins is: 1. Build the parser files using JavaCC via the Ant build file (build.xml) on the . net.sf.eclipsefp.haskell.core.fullparser project 2. Rebuild (clean) the projects: Project > Clean... 3. Run the runtime workbench: Run > Run... > Eclipse Application Maybe I can make a distribution version of the plugins, if you want. Just tell me so... Now on the runtime workbench: 4. Create a core language program (details below) 5. Switch to the debug perspective 6. Debug your program: Run > Debug... > Core Language Application (details below) About the core language --- The core language is an experimental functional language with support to supercombinator definition and function application. There must always be a 'main' supercombinator as a starting point for the evaluation and the supercombinators must be semicolon separated. Enough talk, let's try the following program: double x =3D + x x ; main =3D double (+ 3 1) Note that we use always pre-fixed notation (+ 3 1). The language does not support the in-fixed notation: the expression 3 + 1 would be interpreted as the application of function '3' to arguments '+' and '1'. The if function is defined as following (Haskell notation): if 0 _ elseexp =3D elseexp if _ thenexp _ =3D thenexp So it behaves just like the normal haskell 'if' function, except that the first argument is a number (that is the only type avaible in the core language) and it has C-like semantics: 0 is taken as false and any other value is true. That way you can define a fatorial program: fat n =3D if n (* n (fat (- n 1))) 1 ; main =3D fat 4 I know it looks strange. Remember this is just a experimental language and try it out on the debugger. About the eclipse runner/debugger user interface ---- You will have to Run your programs by opening the Launch configuration dialog and inserting manually the Name of the project and the file name of your program. You may notice there is a context menu entry under the Run menu when you right-click on a file called Run as Core Language Application, but it doesn't work. Please try it out and feel free to send questions and suggestions. I am particular interested in the usefulness of the debugger for the end user. Does it show what the user expects from a function debugger? Is the expression evaluation approach sufficient? Is it intuitive? What do you think about debugging real programs with this approach? Is it practical? --- Java 5.0 available from http://java.sun.com JavaCC 3.2 available from https://javacc.dev.java.net/ Best regards, Thiago Arrais thi...@gm... |
From: Thiago A. <thi...@gm...> - 2005-07-15 19:04:29
|
Hello again, For those of you that are still struggling with the prototype. > It was developed using Java 5.0 and JavaCC 3.2 and you will need both > tools to compile the source code. All the code should be built after I have tested the prototype now using Eclipse 3.0 and it won't run, no matter if you run eclipse with JRE 5.0 or a prior one. Downloading Eclipse 3.1 and JRE 5.0 is almost free (except for your 'net connection costs), so I think it is not worth to investigate this problem any further. The updated requirements list (for now) is: Requirements for compiling the prototype: - Eclipse 3.1 - JSDK 5.0 - JavaCC 3.2 - Ant (if you don't want to run JavaCC by hand) - The default version that ships with eclipse will do Requirements for running the prototype - Eclipse 3.1 - JRE 5.0 (if your compiled binaries are 5.0 compatibility level - as I would recommend it to avoid more trouble) Cheers, Thiago Arrais |
From: Leif F. <lfr...@in...> - 2005-07-18 19:36:11
|
Hi Thiago, First of all thanks for the prototype :-) I'm still a bit busy at the current time, so it just takes a day or two longer for me to reply ... I'm struggling at the moment to run an example core program. I got the projects imported and compiled. A hint that may be useful for anybody who tries to compile the javacc grammar is this: the project must be refreshed (select project and choose 'Refresh' or just hit F5) after the Ant build run so that Eclipse knows the newly generated Java files. Alternatively, you can select 'Refresh resources upon completion' from the External tools tab of the build.xml. I also had to run PDE tools > Update classpath on several projects in order to get some errors away. Then I started the Runtime workbench on a new workspace, created a new project, added a file with double x = + x x ; main = double (+ 3 1) and changed to the Debug perspective. Now I said Run > Debug ... > Core Language App > New, added my file names, and then started. I get then a dialog and the log says: NullPointerException: java.lang.NullPointerException at net.sf.eclipsefp.haskell.internal.debug.CoreLanguageDebugTarget.<init>(CoreLanguageDebugTarget.java:26) at net.sf.eclipsefp.haskell.internal.debug.CoreLanguageProcess.initializeExecutionThread(CoreLanguageProcess.java:47) at net.sf.eclipsefp.haskell.internal.debug.CoreLanguageProcess.<init>(CoreLanguageProcess.java:37) at net.sf.eclipsefp.haskell.internal.debug.CoreLanguageLaunchDelegate.launch(CoreLanguageLaunchDelegate.java:106) at net.sf.eclipsefp.haskell.internal.debug.CoreLanguageLaunchDelegate.launch(CoreLanguageLaunchDelegate.java:99) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:590) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:515) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:733) at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:931) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) That seems to be because the CoreLanguageDebugThread that is created in CoreLanguageProcess returns null for getEventChannel(). Is there something I overlooked? Ciao, Leif |
From: Thiago A. <thi...@gm...> - 2005-07-18 20:59:24
|
Hello Leif, 2005/7/18, Leif Frenzel <lfr...@in...>: [...] > and changed to the Debug perspective. Now I said Run > Debug ... > Core > Language App > New, added my file names, and then started. I get then a > dialog and the log says: NullPointerException: >=20 > java.lang.NullPointerException > at > net.sf.eclipsefp.haskell.internal.debug.CoreLanguageDebugTarget.<init>(Co= reLanguageDebugTarget.java:26) [...] > That seems to be because the CoreLanguageDebugThread that is created in > CoreLanguageProcess returns null for getEventChannel(). Is there > something I overlooked? I am actually inclined to think there is something _I_ overlooked instead. Remember when I said this? 2005/7/15, Thiago Arrais <thi...@gm...> > Darcs will complain about one of the patches: the one that moves the > test code from the parser plugin to a parser test project. But this > isn't a real issue Looks like it is a real issue, because the problem you reported seems like one I had solved some time ago. The server I hosted the repo in is down, so I will send you a distro archive via e-mail with a working version and fix the repo latter for the others to access it. Best regards, Thiago Arrais |