How to debug F#/Nemerle mono application under Linux? - linux

I recently discovered Nemerle and F#, but I can't find any way to debug my applications.
MonoDevelop 2.6 lacks support of Nemerle and F#, 2.4.2 and earlier crashes because of newer gnome-sharp lib is installed (I'm running up-to-date Arch Linux kernel-3.0 64-bit). Command-line mono debugger refuses to start saying "platform not supported". So few questions about this situation:
It is possible to debug mono applications using gdb without going on low-level (inside vm or so) ?
How comfortable to use F# REPL for interactive development without debugger (compared to Common Lisp or Haskell's GHCi)?

I use the F# Interactive environment to write F# code most of the time. Even with Visual Studio, the F# Interactive environment doesn't (reasonably) support debugger, so I mainly rely on the ability to easily run something interactively and see if it works - if it doesn't, it is usually easy to split into sub-components that can be tried interactively too. The great thing about F# Interactive, compared to for example GHCi, is that you can use it to evaluate pretty much anything - including type declarations.
The F# plugin for MonoDevelop 2.4 doesn't currently support debugging of compiled F# applications. I was able to use command line Mono debugger (mdb, I think), but that was on 32bit system.
I'm not sure why MonoDevelop doesn't correctly pick F# debug symbols, so this is most likely some basic bug. There are a few poeple working on F# plugin for MD 2.6, so that should hopefully be available soon. If anybody wanted to investigate why the debugging doesn't work, that would be great...

Nemerle has great IDE support under Windows with Visual Studio and #Develop, better than F#, but there is nothing for Linux, as far as I know.

You can easily debug Nemerle in MonoDevelop.
Just convert pdb to mono format using pdb2mdb tool: http://www.mono-project.com/Guide:Debugger
Than just debug your application, and you get correct locations.
I even managed to debug Nemerle compiler using this trick.

About Linux and Nemerle :
Nemerle got Vim bindings, Kwrite/Kate and some other editors got ntive Nemerle support. You can also add compiler option to any editors in Linux. Nemerle compiler is just works !
Nemerle MonoDevelop support in developing but really slow. F# got outdated MonodeVelop support as #Tomas said but what about new MonoDevelop ? PowerPack ? F# 3 ? That is complex task I think so.
Nemerle is OpenSource project. And I'm not sure about F# 3. I like F# but it's always behind the Microsoft hand. You are free to try both.

Related

Develop Windows applications with Linux tools

I like the Linux operating system and vim editor, but there are many companies that develop under Windows environment in Visual studio etc. There is a possibility that I will have to work for such a company in about a month.
I'd like to do my work on my Linux system and copy the files to them. I have experience with both developments and I found out that I don't want to work with MS products but I like programming and writing MS code is not such a pain.
Are you a similar developer? Could you give me some advice about your methodology to be most of the time on Linux platform, to create code and debug everything in vim on Linux and only when neccessary open Visual Studio with Windows forms and similar things and test the things that weren't possible to test in Linux environment?
I would see the work in creating small peaces of code on Linux, testing them and then move it to MS platform and integrate to the whole system. How do you debug and test your code? The development will be probably in C# or C++. I can't imagine Visual Basic.
Please write here your experience, style of work, if this has sence or there are too many troubles and I should rather give up.
So the question is: How to develop applications that run on Windows with Linux tools, without touching Visual Studio and browsing with Windows file manager etc.
thank you
Not sure, if this will help you or not but there is a Vim Emulation layer for Visual Studio 2010 called VsVim.
Check out : http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329
If I were you I'd install MinGW or Cygwin on your windows machine and just use gvim/vim anyway (or maybe just use the Win32 vim).
VS is just a big editor. You'll be building with the microsoft compilers ( perhaps using msbuild or nmake ) but probably are going to have to accept that you can only debug windows things with VS ( unless you build for MinGW or Cygwin and use gcc and gdb)
You can use vim as a code editor, you can even stick on Linux when developing software for the .NET platform. The people behind the Mono make this happen. Mono is a software platform designed to allow developers to easily create cross platform applications. It is an open source implementation of Microsoft's .Net Framework based on the ECMA standards for C# and the Common Language Runtime.
You can stick to the editor of your liking and use the tools that come with Mono to compile your stuff. There is a IDE called Mono Develop, but compared to Visual Studio it is pretty basic... and compared to VIM it lacks simplicity.
C# projects are plain text files so it's easy enough to edit them over an SMB share in whatever editor you wish from anywhere the sysadmins let you.
Testing however will be difficult without going back to the windows machine, and while Mono implements the framework, it's still a different environment if you're targeting Windows.

Is there any Visual C++ compiler for linux supporting most of VS Visual C++?

Is there any Visual C++ compiler for linux supporting most of VS Visual C++?
If there is no such what is best alternative for porting\adapting your visual C++ code to?
Visual C++ refers to an Integrated Development Environment and C++ Compiler. It is strictly Windows only * implementation* for all practical intents and purposes.
C++ is a language. Linux has several compilers for C++. If you use non-portable extensions, such as #pragma once instead of include guards, using the DLL import/export stuff, or the Windows APIs type system, then your code will be less portable between implementations. Much of this can be controlled with judicious use of the pre processor and some common sense.
The best way is to write portable code and libraries in the first place. It is not as hard as it sounds.
Now for this comment: I will apologise for sounding offensive, but if you can't tell the difference between "C++" and "Visual C++", please learn such elements of the English language (and C++). It will help you in the long run, programming wise.
Compilers for Linux -> GNU C/C++ (GCC/G++). See also Intels compiler.
IDEs for Linux -> generally run on Windows too, check wikipedia.
Mono supports running CIL-only (meaning no mixed-mode assemblies) C++/CLI assemblies, but there's no C++/CLI or Managed C++ compiler on Linux.
You can read information about this in the Mono project page: http://www.mono-project.com/CPlusPlus
If you mean a compiler that supports most of the VS extensions/standards non-compliance you're out of luck. If you mean an environment to compile/port to Linux, I would just use g++ and get yourself an editor such as Emacs. I've also heard good things about Code::blocks.
I don't think there's a compiler for Managed C++ or C++/CLI other than for Windows. The Mono project (.NET for Linux) has a C# compiler, although I don't know how up to date that is.
Anyway, I thought the whole idea about .NET was that it is a platform in itself. Can't you just run your Windows executables on Mono?
When I am porting my Windows code to Linux, I usually use Eclipse in Windows along with minGW.
I use NetBeans with TDM-GCC. Unfortunately I have not been able to get gdb to work under windows.

web developer tools linux

I started using Linux for PHP web development. What is a helpful toolset to use for web development (mostly PHP) available for the Linux platform. My Current IDE is netbeans and I am happy with it.
In no particular order, my perfect environment consists of:
vim - text editing
git - version control
screen - terminal management
This is all you really need to build a great app in any language, for that matter (baseline). Every language has its specifics, but the above will more than get you started.
The PDT project provides a PHP
Development Tools framework for the
Eclipse platform. This project
encompasses all development components
necessary to develop PHP and
facilitate extensibility. It leverages
the existing Web Tools Platform (WTP)
and Dynamic Languages Toolkit (DLTK)
in providing developers with PHP
capabilities.
You can have a try for eclipse.
http://www.eclipse.org/pdt/
Another one not mentioned in this thread (suitable for PHP and a lot of other dynamic languages):
Komodo Edit (free version of the Komodo IDE)
I really like using Netbeans and SqlSquirrel. Both of these tools are written in Java and they are cross platform compatible. Also an odd note about SqlSquirrel: It uses the Netbeans editor. Also, if you like there are many tutorials and articles on using PHP with Netbeans on their site. Overall, go with the toolset that you like the most. There isn't a single toolset that works with everyone, and for all problems.
I like Eclipse PDT, and it can be used both on Windows (which I use at work) and on Linux (which I use at home).
Features are quite the same as netbeans, I'd say ; especially, you've got nice stuff like graphical debugging, when used with Xdebug.
I'd say that, these days, when it comes to a modern full-IDE for PHP, that works on Linux, and is free, there are two choices : netbeans and Eclipse PDT. Which one you prefer is generally a matter of taste, as far as I can tell.
If you're happy with NetBeans, stick to that as you IDE. Learn to use Vim or emacs just for common knowledge. Use version control, Subversion and git are good choices.
The power of linux is in the command line. Whatever you do outside the IDE, learn to do it with command line. After a while you'll be comfortable with it and you'll discover that there's bunch of stuff you never want to do with GUIs anymore :)

How to use F# with mono on linux?

I have had difficulty figuring out how to use F# on Linux - I would really appreciate help.
Well, My box: Ubuntu, mono, fsharp, emacs and fsharp-mode
with fsharp-mode you have
highlighting
interactive console
emacs :-).
Also, you can try to install .net 2.0 on wine (with winetricks for example) together with sharpdevelop 2.2.
Personaly i've decided to use emacs and fsharp-mode.
UPDATE:
another option is to use regular editor such as kate in OCaml mode but it can be inconvenient due to differences between languages.
Here's a similar question with detailed answers:
How to get F# working with Mono?
Simple example of compilation command can be found at here:
http://gist.github.com/raw/144209/02f2f4450ed8261c5e4f3c18055de89ff0db9612/FebKit.fs
This question is quite old now, but this can help other people. In CodePlex there is a project called F# cross-platform packages and samples. It has some linux packages (and also for Mac). Click here for the download page.
Google for F#, and the very first entry that comes up is http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/ - and one of the first things on that page is:
Download F# now --> Visual Studio 2010, or CTP Update for Visual Studio 2008 or standalone compiler+library ZIP, for Mono and Windows
Have you installed that, and is something not working for you?
Keke, this is a late answer, but I have a post that explains how you can install F# under Linux and Mac systems. It assumes you understand how to compile software for Linux.
Here it is: http://blog.gnucom.cc/2009/installing-f-on-ubuntu-8-04/
Let me know what you think.

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7.
I am looking for seting-up a development environment (mainly c/c++/bash/python) on my windows machine. Solutions i tired -
VirtuaBox latest, with grml-medium (very light debian-based distro)
some how managed to install it in VBox, but lots of issues still regarding Guest-Additions, sharing files, screen-resolutions. Tired with it, now.
MinGW
installed it, added to %PATH%, along with GVIM. Now i can use powershell, run gvim, vim, and mingw from the shell as bash. But no manpages, its a lot of convenience to have them availble, locally and offline. But i think it gives me a gcc development
Do i need mySys now. i can installed it if it provides me with manpages and ssh.
Cygwin
Has avoided till now. But i think it will give me manpages, gcc-utils, python-latest.
Something called Interix.
any taker for that. is it recommened.
What are the best practices? What are you guys following, i dont have a linux-box to ssh to, well if Vbox things works fine at some point of it, i can then ssh to my VBox. I have lost of time setting it up, so abandoning it for a while.
I think only VirtualBox solution will let try things like IPtables, or other linux-system-frameworks.
I checked this
Best setup for Linux development from Windows?
do you recommend coLinux or its derivatives. If yes advices or consideration before i try that.
I recommend VirtualBox+Ubuntu. Cygwin just doesn't cut it for certain tasks and is in beta for Win7.
Here is what I do for Python development on Windows:
EasyEclipse for Python (includes eclipse, subclipse, pydev)
GNU Win32 Native Windows ports for GNU tools
Vim and Emacs (for non-IDE editing work)
I would see if MSysGit can provide what you want first. also since man pages aren't really anything hugely impressive... it might just be possible to just copy them. I've had problems with cygwin, although to be honest I'm not happy with MSys, MSysGit, or Cygwin. I wish someone would build one that was more... linux like. I would if I had to use windows every day, fortunately I only have to use windows sparingly.
IMO I'd say VirtualBox + Gentoo Linux + KDevelop4, Gentoo will give you the control you need over your environment.
I'm doing exactly the opposite of you, I have gcc/qt4 installed on wine to compile for windows and using Linux primarily.
If you want to do development of POSIX applications (mostly command line), with all the familiar Linux tools, then cygwin is your best bet.
It probably include everything you are used to.
But if you will try to do Windows development (anything with UI, drivers, services), then Visual Studio is really gold.
And in general Visual Studio is just great for anything, if you want to spend the time and money. Good IDE, great debugger. I highly recommend it. And if you are in Rome, do what the Romans do :-)
I would recommend Bloodshed DevC++ as a good basic non-microsoft specific Windows solution for developing ANSI C/C++ code. Personally I just use Visual Studio 2008 and ignore all the Microsoft specific extensions.
For Python there is the wonderful Komodo Edit software that is free, personally the IDE version is what I prefer, but I use an old 3.5.3 version that works for me. And they have a very popular Python package called ActivePython as well, that has a bunch of Windows specific extension modules.
Personally cygwin just feels and acts like a hack to me and is painful to setup and maintain. I think running Linux/Unix in a Virtual Machine is much less hassle if you are looking for a *nix environment. Getting a really genuine *nix environment feel is going to be very hard under Windows.
The following suggestions hold if you are not going to do complex template programming as the c++ IDE's other than visual studio SUCK, they cannot efficiently index modern C++ code (the boost library).
I would suggest using Netbeans (it has far better support for C++ than eclipse/CDT) with the following two build environments. Both are important if you want to cross-compile and test against POSIX and win32. This is not a silver-bullet, you should test on different variants of UNIX once in a while:
I would suggest installing Mingw and Msys for windows development, its nice when you can use awk, grep, sed etc on your code :D generative programming is easier with shell tools as well -- writing generative build scripts is a bitch to do effectively of the command line in windows (powershell might have changed this).
I would ALSO suggest installing Cygwin and using that on the side. Mingw is for programming against the win32 low-level API, Cygwin is for programming against the POSIX standard. Cygwin also compiles a lot of software that you would otherwise have to port.
Also once you get your project up and running you can use CMAKE as build environment, its the best thing since sliced bread :P You can get it to spit out build definition for anything and everything -- including visual studio.

Resources