Do Azure serverless functions written in JavaScript compile for every execution?

In an Oct 16th blog post by Ben Lugavere on Medium.com he states: “In the world of serverless, packages and infrastructural dependencies are installed and cached at in the container layer but on every execution a new process is spawned where the function handler is actually executed. This means that for every function execution, all synchronously imported modules need to be evaluated and executed, and all initialization db connections and db calls need to take place, before your business logic actually runs.” I’m building a large Azure function comprised of 40 large modules, with many imports in each to provide the connectivity. (This is JavaScript that is converted VB.Net code.) Since the front end is a React SPA, I’m thinking that I should just make this function an included component that can be lazily loaded. I’m a solo developer at home so I would welcome any advice.

How do I compile programs using the windows 10 linux environment?

I am a beginner to linux. I’ve installed the Ubuntu and Debian subsystems for windows. I have to admit, I expected them to behave like powershell and command prompt do, with commands like ls (or dir, or other variations on these) working. Therefore, I expected that I could drop a file into the virtual directory used by the subsystem, and type something like gcc … “myfile.c” to compile and build, and then run the program in the subsystem.

However, when I use bash, I can’t tell where my linux directory is, it won’t let me navigate anywhere, commands, like ls, return no information, and I generally cannot find documentation about how to use the bash to do simple things like compile programs.

Can someone help me, please?

apt – Satisfy dependency with manual compile and install

I am using Ubuntu 18.04. My coding project needs cmake 3.18 support, so I do a manual compile and install. Now I want to remove version 3.10 that came as a dependency from another package, WITHOUT removing said package. Is there a way?

What i found so far was a way to prevent the install of cmake via apt, but I do not know if this helps me here: How to forbid a specific package to be installed?

Thanks!

operating systems – Why can’t we compile 8086 Assembily for all OSs from any OS?

Porting to a different operating system is about a lot more than the particular assembly language you use. Different operating systems have different system calls, different libraries, and different APIs, and converting from one to another is usually not something that can be done in an automated way — even if both used exactly the same assembly language. Most programs do need to access the filesystem, the network, display things on the screen, and so forth, and all of those require interaction with the OS and libraries.

c++ – Which version of Quake 2 source code do I need to compile to work with version 3.20 map packs?

I’m a big fan of Quake 2 game. Recently I’ve decided to spend some of my free time for digging into the Quake 2 src code. There are 2 versions of the full game code 3.19 and 3.21 (including the game exe as well as the game dll).

As regards to the Q2 Mission Packs the src files for both The Reckoning and Ground Zero are rather of verions 3.20 as the filename suggests (xatrixsrc320.exe and roguesrc320.exe)

My question is WHICH version of the game exec do I have to compile to use with the mission pack dlls? Is it better to use the 3.21 exe together with 3.20 of the xatrix & rogue dlls, or maybe the older 3.19 would be more appropriate?

compile – Mathematica does not recognize c compiler

I have Mathematica 11.1 and Windows 10 OS. I need to use c based compilation inside Mathematica, like Compile(..., CompilationTarget -> "C", CompilationOptions -> {"InlineExternalDefinitions" -> True}).

To do this, I have first downloaded Microsoft C++ Build Tools 2019. Then I have installed it. Finally, following answers on this question, I have modified the VisualStudioCompiler.m file, adding there
“2019” to the list of $VisualStudioVersions and the string

installPath("2019") := installPathFromEnvironment("VS166COMNTOOLS")

(the version of C++ build tools is 16.6, which is reflected in VS166…).

However, when launching

Needs("CCompilerDriver`")
CCompilers(Full)
CCompilers()

I get {}.

Could you please tell me what have I made wrong?

matrix – Fast approach to do losummation in Compile[]?

My code does massive Summation and Matrix multiplication

Compile() has boosted it distinctly. But I read some literatures related to my program, It seems there are approches to make it even faster. Maybe it can be improved from optimizing MMA language or algorithm itself.

My first piece code is below.

MomentComputing = 
 Compile({{Mmax, _Integer}, {k, _Integer}, {image, _Real, 
    2}, {xLegendreP, _Real, 2}, {yLegendreP, _Real, 2}}, 
  Block({m, n, width, momentMatrix},
   width = Length(image);
   momentMatrix = Table(0., {Mmax + 1}, {Mmax + 1});
   Do(
momentMatrix((m + 1, n + 1)) = ((2. (m - n) + 1.) (2. n + 1.)/((k k)*width width)) xLegendreP((
        m - n + 1)).image.yLegendreP((n + 1)), {m, 0, Mmax}, {n, 0, 
     m});
   
   momentMatrix), CompilationTarget -> "C", 
  RuntimeAttributes -> {Listable}, Parallelization -> True,  
  RuntimeOptions -> "Speed")

It should be better if I don’t use any loop operations. But I can not figure out any other approaches. Probably matrix vector multiplication should be time-consuming as well.

Second piece.

Reconstruction = 
  Compile({{lambdaMatrix, _Real, 2}, {lPoly, _Real, 2}}, 
   Block({Mmax, width, x, y, m, n, reconstructedImage},
    {Mmax, width} = Dimensions(lPoly);
    reconstructedImage = Table(0., {width}, {width});
    Do(
     reconstructedImage((x, y)) = 
      Sum(lambdaMatrix((m + 1, n + 1))*lPoly((m - n + 1, x))*
        lPoly((n + 1, y)), {m, 0, Mmax - 1}, {n, 0, m})
     {x, 1, width}, {y, 1, width});
    reconstructedImage), CompilationTarget -> "C", 
   RuntimeAttributes -> {Listable}, Parallelization -> True, 
   RuntimeOptions -> "Speed");

Likewise, I don’t want Do() loop here. In addition, I think Sum() is a very slow function.

I can give all my code if necessary.

Edit 1:

According to Micheal’s suggestion, the first part is fast enough. It does not need acceleration anymore. The second part is the main time-consuming part, I believe it can speed up anyway.

debugging – Debug orign source code after post compile with mono

I have to analysis performance issue of a .net core libarary in super detail level without invasive the source code, so i decide using compile IL – wave, and everything works fine. Still there is a problem that I can’t debug the post compile dlls with visual studio using origin source code.

I have read post about .pdb, and it not help
I have mark the AOP class as (DebuggerNonUserCode, DebuggerStepThrough, CompilerGenerated), and it still not work for me
I have set VS debugger without code line matches

Any help?

Simple source code:

class Program
    {
        static void Main()
        {
            Console.ReadLine();
        }
    }

Mono code:

class Program
    {
        static void Main()
        {
            AssemblyDefinition assembiy = AssemblyDefinition.ReadAssembly(file, new ReaderParameters() { ReadSymbols = true });
            var logClass = assembiy.MainModule.ImportReference(typeof(AopLogger));
            var methods = assembiy.MainModule.Types.Select(p => p.Methods);

            foreach (var item in methods)
            {
                foreach (var sub in item)
                {
                    var worker = sub.Body.GetILProcessor();//Get IL

                    var Constructor = assembiy.MainModule.ImportReference(typeof(AopLogger).GetConstructor(new Type() { }));//Create Instance

                    var ins = sub.Body.Instructions(0);//Get First IL Step

                    worker.InsertBefore(ins, worker.Create(OpCodes.Newobj, Constructor));

                    MethodInfo log = typeof(AopLogger).GetMethod("Log");
                    worker.InsertBefore(ins, worker.Create(OpCodes.Call, assembiy.MainModule.ImportReference(log)));
                }
            }

            assembiy.Write(file, new WriterParameters() { WriteSymbols = true });
        }
    }


(DebuggerNonUserCode, DebuggerStepThrough, CompilerGenerated)
    public class AopLogger
    {
        (DebuggerHidden)
        public void Log()
        {
            StackTrace st = new StackTrace();
            Console.WriteLine(new string('t', st.FrameCount - 2) + st.GetFrame(1).GetMethod().ReflectedType.FullName + "." + st.GetFrame(1).GetMethod().Name);
        }
    }

functioncompile – Error on using Compile[]

My code is below.

deltaX = 1/128;
W=256;
Mmax=40;

lPoly = ParallelTable(
   LegendreP(
    order, (-1.) + (deltaX/2.) + ((index - 1.)*deltaX)), 
{order, 0, Mmax}, {index, 1, W});

XPoly = Compile({{index, _Integer}}, 
   Block({}, 
    polyMatrix = 
     PadRight(Table(lPoly((m - n + 1, index)), {m, 0, Mmax}, {n, 0, m})); 
    polyMatrix), CompilationTarget -> "C",
   RuntimeAttributes -> {Listable}, Parallelization -> True, 
   RuntimeOptions -> {"CatchMachineIntegerOverflow" -> False});

If I run XPoly(1), it will return:

CompiledFunction::cfse :  Compiled expression {{1.},{-0.996094,1.},<<48>>,<<71>>} should be a machine-size real number.

I have encountered this kinda error multiple times, sometimes it solved. But I dont know why.