Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
Pas2JS
»
Asm.js optimizations
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
[SOLVED] Transparent back...
by
ginoo
[
Today
at 09:31:18 am]
Parametrized Access SQL Q...
by
Khrys
[
Today
at 07:12:03 am]
How to set the Excel cell...
by
dodgex
[
Today
at 06:01:11 am]
BS PanelTrans - transform...
by
Xenno
[
Today
at 05:54:55 am]
Why does FPC behave this ...
by
440bx
[
Today
at 04:41:50 am]
PngDrop: Reduce the size ...
by
ALLIGATOR
[
Today
at 04:05:04 am]
RTTIPropertyGrid expand
by
jamie
[
Today
at 03:17:43 am]
What was your first compu...
by
TBMan
[
Today
at 02:19:55 am]
Fantasy Worldbuilder; Pro...
by
Boleeman
[
Today
at 01:28:33 am]
Sum GNU Anti Reversi 8x8 ...
by
Boleeman
[
Today
at 12:42:53 am]
StrToDateTime problems
by
andyH
[
Today
at 12:28:42 am]
How to forward a Class in...
by
Bart
[January 12, 2026, 10:35:22 pm]
Picture Process with BGRA...
by
circular
[January 12, 2026, 08:05:53 pm]
[SOLVED] Average color
by
LeP
[January 12, 2026, 06:51:24 pm]
set zero values not to b...
by
wp
[January 12, 2026, 06:25:48 pm]
HELP Why the WriteRowHeig...
by
wp
[January 12, 2026, 06:22:24 pm]
building a Calculator usi...
by
Dzandaa
[January 12, 2026, 03:51:20 pm]
How can Lazarus implement...
by
Tommi
[January 12, 2026, 03:46:47 pm]
how to relay a button cli...
by
srvaldez
[January 12, 2026, 01:15:46 pm]
what was your first pasca...
by
BSaidus
[January 12, 2026, 01:01:32 pm]
Lazarus and Libre Office
by
sydenis
[January 12, 2026, 11:07:38 am]
[SOLVED] Able to access p...
by
vinntec
[January 12, 2026, 09:27:53 am]
How to execute PKZIPC fro...
by
Hozso
[January 12, 2026, 08:17:36 am]
Jerky animation (windows)
by
Roland57
[January 12, 2026, 07:19:29 am]
RPNCalc in Lazarus
by
tailkinker
[January 12, 2026, 04:42:09 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Asm.js optimizations (Read 2889 times)
lainz
Hero Member
Posts: 4740
Web, Desktop & Android developer
Asm.js optimizations
«
on:
April 13, 2019, 09:19:46 pm »
Asm.js
https://en.wikipedia.org/wiki/Asm.js
Is the pas2js output javascript code optimized like is described in that wiki article, for example:
Code: C
[Select]
[+]
[-]
int
f
(
int
i
)
{
return
i
+
1
;
}
That in Pascal is something like:
Code: Pascal
[Select]
[+]
[-]
function
f
(
i
:
integer
)
:
integer
;
begin
Result
:
=
i
+
1
;
end
;
And translated to Asm.js
Code: Javascript
[Select]
[+]
[-]
function
f
(
i
)
{
i
=
i
|
0
;
return
(
i
+
1
)
|
0
;
}
The extra "|0" converts the variables to int32 acording to the article, so it doesn't use floating point math.
«
Last Edit: April 13, 2019, 09:24:29 pm by Lainz
»
Logged
https://lainz.github.io/
mattias
Administrator
Full Member
Posts: 206
Re: Asm.js optimizations
«
Reply #1 on:
April 13, 2019, 10:08:28 pm »
No, but it would be possible to add an option to do so.
I did not take a look what other conversions are needed, so I can't estimate how much work it is.
Logged
lainz
Hero Member
Posts: 4740
Web, Desktop & Android developer
Re: Asm.js optimizations
«
Reply #2 on:
April 13, 2019, 11:43:00 pm »
Hi thanks for the quick response.
Ok it will be great and another reason to choose pas2js instead of emscriptem.
Logged
https://lainz.github.io/
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
Pas2JS
»
Asm.js optimizations
TinyPortal
© 2005-2018