What kinds of patterns could I enforce on the code to make it easier to translate to another programming language? [closed]

I’ve been building tools (DMS Software Reengineering Toolkit) to do general purpose program manipulation (with language translation being a special case) since 1995, supported by a strong team of computer scientists. DMS provides generic parsing, AST building, symbol tables, control and data flow analysis, application of translation rules, regeneration of source text with comments, etc., … Read more

Why does this (null || !TryParse) conditional result in “use of unassigned local variable”?

I am pretty sure this is a compiler bug. Nice find! Edit: it is not a bug, as Quartermeister demonstrates; dynamic might implement a weird true operator which might cause y to never be initialized. Here’s a minimal repro: class Program { static bool M(out int x) { x = 123; return true; } static … Read more

How to approach creating a JVM programming language?

I would also recommend ASM, but have a look at Jasmin, I used it (or, rather, had to use it) for a university project, and it worked quite well. I wrote a lexer-parser-analyzer-optimizer-generator combination for a programing language using Java and Jasmin, so it was generating JVM Code. I uploaded the code here; the interesting … Read more

implementing type inference

I found the following resources helpful for understanding type inference, in order of increasing difficulty: Chapter 30 (Type Inference) of the freely available book PLAI, Programming Languages: Application and Interpretation, sketches unification-based type inference. The summer course Interpreting types as abstract values presents elegant evaluators, type checkers, type reconstructors and inferencers using Haskell as a … Read more

Why is it impossible to build a compiler that can determine if a C++ function will change the value of a particular variable?

Why is it impossible to build such a compiler? For the same reason that you can’t write a program that will determine whether any given program will terminate. This is known as the halting problem, and it’s one of those things that’s not computable. To be clear, you can write a compiler that can determine … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)