Why does the Dart2JS compiler not generate code that includes "use strict" at the top of each of the script files? If all generated Javascript code is valid ECMA5 code, then shouldn't the compiler automatically add the "use strict" command?
Update:
Apparently this is already being tracked by issue 1686.
To formally answer, this feature request can be found in issue 1686 in the Dart issue tracker.
As for why, there hasn't been much demand for it and the dart2js team has been focused on language conformance and performance.
Related
Has anyone run into this error message before? Google found it for me in the source code (https://github.com/fsharp/fsharp/blob/master/src/fsharp/tast.fs), but I haven't the slightest idea what is causing it.
This started happening when I tried to upgrade my library project from .NET 5 to .NET 6, so the real answer to my question may be an explanation of what I did wrong there. All I did was the following:
In the fsproj, changed "TargetFramework" from "net5.0" to "net6.0"
In my paket.dependencies file, changed "framework" from "net5.0" to "net6.0". (I've also tried commenting out the "framework" line.)
Then after running "paket update" and "dotnet build" I get the obscure error. ("error FS0192 : internal error : No compiled representation for provided namespace")
UPDATE: After some laborious code commenting/uncommenting, etc., I believe I've narrowed this down to my code's use of the Fable.RegexProvider assembly. (I use the SafeRegex component.) RegexProvider hasn't been updated in a couple years. I'll alert the folks over there to this issue, and I'll post an update here if/when I learn anything. (In case anybody else runs into this.)
In case anyone else runs into this, here is the solution (which is the solution #CaringDev recommended above, though it only works for Fable 3.7.18 and after):
When I raised this issue on the Fable.RegexProvider github (see thread here: https://github.com/fable-compiler/Fable.RegexProvider/issues/9), the initial thought was to try a .NET 6 build of Fable.RegexProvider. But then Alfonso Garcia-Caro realized that subsequent improvements to Fable may have obviated the need for SafeRegex.
He ultimately needed to tweak something in Fable, but as of version 3.7.18, the Fable transpiler supports the use of FSharp.Text.RegexProvider, such that Fable.RegexProvider is now unnecessary.
we're using https://github.com/firelyteam FHIR library in a Xamaring application.
When testing in iOS we discovered the PlatformNotSupportedException because of the use of Emit.
We then discovered we could use the Xamarin interpreter: https://devblogs.microsoft.com/xamarin/introducing-xamarin-ios-interpreter/
and it just works!
I have some questions/doubts:
is there any difference between the "Enable the mono interpreter" option or adding "--interpreter" to "Additional mtouch arguments"
is it possible to limit the interpreter to specific libraries? I'm under the impression is now globally enabled. I tried with "--interpreter=FHIR.HL7.Support" but I'm not sure it's working: inspecting the .ipa seems to containe .aotdata for everything. I was under the impression that aotdata was not produced when interpreted
can you suggest better solutions?
Thanks a lot
You can use --interpreter=assemblyname,.... to only allow the interpreter to work on just those assemblies, i.e. include the IL in only those assemblies.
I'm trying to compile a dependent libraries from the source code and I've got this error:
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include/unistd.h:446:8:
note: 'fork' has been explicitly marked unavailable here pid_t
fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
Is there any way to resolve this issue?
The thing is that I don't actually even need this functionality. When I compile this code for iOS and run it under tvOS then it works.
But I can not submit the application because it contains code compiled for iOS.
What would be the good trick to substitute there a dummy fork() function so it compiles OK (believing that it is not actually used by my specific use-cases).
I don't believe there is a way round this. You cannot create processes under iOS and tvOS is 90% iOS, so the same restriction applies.
You'll have to conditionally compile-out that section of code for iOS/tvOS.
NSDeprecated which tunnels through CF_Deprecated into the clang attribute availability only handles deprecation for MACOSX and IOS.
Are there any calls or series of macros that replicate this tool for third parties.
I am working on V2 of an SDK and there are certain calls we want to deprecate as well as EOL.
(Please note, this SDK is still in Objective-C; so Swift only solutions don't solve my issue)
The deprecation warnings and errors would be fantastic at compilation and code generation time; however, I fear this is something I'd need to spin on my own.
Any pointers or reference on this before I have to decide if I need to kill the time on this side project?
You can #define a macro in your SDK project to make a shorthand for the deprecation message. We did something similar in the Core Plot project.
There is a function attribute deprecated provided by GNU compiler.
The syntax to mark deprecated functions is:
void Foo() __attribute__( (deprecated("message", "replacement")) );
The first one is the message to display when emitting the warning; the second one enables the compiler to provide a Fix-It to replace the deprecated name with a new name.
More information on using function attributes can be found in GCC Attribute Syntax documentation or Attributes in Clang documentation
some handy macros are in the NSObjCRuntime.h from Apple.
NS_DEPRECATED_IOS(6.0,10.0)
works like a charm.
Just curious if MonoTouch has support for "Module Initializers"?
http://blogs.msdn.com/b/junfeng/archive/2005/11/19/494914.aspx
Related question: Does Mono support "Module Initializers"?
Your first link answer, at least half, your own question. The Mono runtime supports Module Initializers and the test done (to prove this) was executed with Mono's JIT.
MonoTouch uses the JIT when executing on the iOS simulator, so there's no reason why it would not work there.
It likely works (or it's a bug) for devices too, i.e. where the AOT compiler is being used. As Jason said, it's a matter of testing it. If you cannot test it yourself simply fill a bug report and attach a (self-contained) test case to it and we'll confirm if it works (or keep the bug open until it does).
From the MSDN article you linked to
Since C# does not support global functions, C# does not support module
initializer.