-
Notifications
You must be signed in to change notification settings - Fork 0
/
Home.html
1113 lines (978 loc) · 24 KB
/
Home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ATS-PL-SYS</title>
<style>
.center {
margin-left: auto;
margin-right: auto;
}
.command_line {
width:96%;
margin:auto;
padding:10px;
color: #000000;
background-color: #D0D0D0;
border-radius:6px
}
#thePageLeft {
/*
parent: thePage
children:
*/
height: 100%;
} /* thePageLeft */
#thePageRHeaderTop {
/*
parent: thePageRHeader
children:
*/
} /* thePageRHeaderTop */
#thePageRHeaderSep {
/*
parent: thePageRHeader
children:
*/
background-color: rgb(143,2,34);
} /* thePageRHeaderSep */
#thePageRHeader {
/*
parent: thePageRight
children: thePageRHeaderTop, thePageRHeaderSep
*/
} /* thePageRHeader */
#thePageRBodyLHeader {
/*
parent: thePageRBodyLeft
children:
*/
} /* thePageRBodyLHeader */
#thePageRBodyLContent {
/*
parent: thePageRBodyLeft
children:
*/
} /* thePageRBodyLContent */
#thePageRBodyLeft {
/*
parent: thePageRBody
children: thePageRBodyLHeader, thePageRBodyLContent
*/
height: 100%;
} /* thePageRBodyLeft */
#thePageRBodyRight {
/*
parent: thePageRBody
children:
*/
height: 100%;
} /* thePageRBodyRight */
#thePageRBody {
/*
parent: thePageRight
children: thePageRBodyLeft, thePageRBodyRight
*/
} /* thePageRBody */
#thePageRFooterSep {
/*
parent: thePageRFooter
children:
*/
background-color: #8f0222;
} /* thePageRFooterSep */
#thePageRFooterRest {
/*
parent: thePageRFooter
children:
*/
} /* thePageRFooterRest */
#thePageRFooter {
/*
parent: thePageRight
children: thePageRFooterSep, thePageRFooterRest
*/
} /* thePageRFooter */
#thePageRight {
/*
parent: thePage
children: thePageRHeader, thePageRBody, thePageRFooter
*/
height: 100%;
} /* thePageRight */
#thePage {
/*
parent: theBodyProp
children: thePageLeft, thePageRight
*/
height: 100%;
background-color: #ffffff;
} /* thePage */
#theBodyProp {
/*
parent:
children: thePage
*/
height: 100%;
} /* theBodyProp */
body {
margin-top: 8px;
margin-bottom: 8px;
margin-left: 0px;
margin-right: 0px;
font-family: Helvetica, Arial, sans-serif;
background-color: #213449; /* dark blue */
}
#thePageRHeader {
text-align: center;
}
#thePageRFooter {
text-align: center;
}
#thePageLeft {
/*
background-color: #1e5799;
background-image: linear-gradient(to right, #1e5799, #7db9e8);
*/
background-color: rgba(30, 87, 153, 0.750);
}
#thePageRBodyRight
{
font-size: 88%;
background: #d1d360;
overflow-y: auto;
border-top-left-radius:12px;
/*
border-bottom-left-radius:12px;
*/
}
.thePageRBodyLContent
{
margin-left: 8px;
margin-right: 8px;
padding-top: 12px;
}
</style>
<link
rel="icon" type="image/gif"
href="./MYDATA/favicon_animated.gif">
</link>
<script
src="./SCRIPT/jquery-2.1.1.min.js">
</script>
<script
src="./CLIENT/MYCODE/libatscc2js_all.js">
</script>
<script
src="./CLIENT/MYCODE/libatscc2js_print_store_cats.js">
</script>
<script
src="./CLIENT/MYCODE/atslangweb_utils_dats.js">
</script>
</head>
<body>
<div id="theBodyProp">
<div id="thePage">
<table
style="width:100%;height:100%;"
cellspacing="0" cellpadding="0">
<tr height="100%">
<td style="vertical-align:top;width:14%;">
<div id="thePageLeft">
<style>
#thePageLeft
{
color: #483D8B;
/*
color: rgba(72,61,140,0.750);
*/
}
#thePageLeft
{
position: fixed;
min-width: 14%;
}
#thePageLeft td.self
{
font-weight: bold;
}
#thePageLeft td.other
{
font-weight: normal;
}
.thePageLeft_menu
{
width: 88%;
margin: auto;
padding: 12px;
border-radius: 12px;
background-color: rgba(255,255,240,0.375);
}
</style>
<table
width="100%"
>
<tr>
<td height="156px" align="center">
<img src="./MYDATA/theLogo.png" alt="ATSlogo" style="height:72%"></img>
</td>
</tr>
<tr>
<td>
<table
class="thePageLeft_menu"
>
<tr><td name="Home" class="self">Home(<a href="http://ats-lang.sourceforge.net">old</a>)</td></tr>
<tr><td name="Downloads" class="other"><a href="Downloads.html">Downloads</a></td></tr>
<tr><td name="Documents" class="other"><a href="Documents.html">Documents</a></td></tr>
<tr><td name="Libraries" class="other"><a href="Libraries.html">Libraries</a></td></tr>
<tr><td name="Community" class="other"><a href="Community.html">Community</a></td></tr>
<tr><td name="Papers" class="other"><a href="Papers.html">Papers</a></td></tr>
<tr><td name="Examples" class="other"><a href="Examples.html">Examples</a></td></tr>
<tr><td name="Resources" class="other"><a href="Resources.html">Resources</a></td></tr>
<tr><td name="Implements" class="other"><a href="Implements.html">Implements</a></td></tr>
<tr><td><a href="https://sourceforge.net/projects/ats-lang/lists/ats-lang-users">Mailing-list</a></td></tr>
<tr><td><a href="https://groups.google.com/forum/#!forum/ats-lang-users">ats-lang-users</a></td></tr>
<tr><td><a href="https://groups.google.com/forum/#!forum/ats-lang-devel">ats-lang-devel</a></td></tr>
<tr><td><a href="#" onclick="Home_tryatsnow_onclick()">Try ATS on-line</td></tr>
</table>
</td>
</tr>
</table>
<!--php-->
</div><!--thePageLeft-->
</td>
<td style="vertical-align:top;width:86%;">
<div id="thePageRight">
<div id="thePageRHeader">
<div id="thePageRHeaderTop">
<style>
#theHeaderLine1 {
margin-top: 0px;
margin-bottom: 0px;
padding-top: 48px;
padding-bottom: 2px;
font-size: 250%;
font-weight: bold;
}
#theHeaderLine2 {
margin-top: 0px;
margin-bottom: 0px;
padding-top: 2px;
padding-bottom: 32px;
font-size: 160%;
font-weight: bold;
}
</style>
<div id="theHeaderLine1">The ATS Programming Language</div>
<div id="theHeaderLine2">Unleashing the Potentials of Types and Templates!</div>
</div><!--thePageRHeaderTop-->
<div id="thePageRHeaderSep">
<style>
#thePageRHeaderSep
{
color: #FFFFF0;
}
#thePageRHeaderSepL
{
text-align: left;
padding-left: 2px;
}
#thePageRHeaderSepL ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#thePageRHeaderSepL ul li
{
float: left;
/*
display: inline;
*/
border-width: 1px;
border-color: #ffffff;
border-right-style: double;
padding-left: 8px;
padding-right: 8px;
}
#thePageRHeaderSepL li.self
{
font-weight: bold;
}
#thePageRHeaderSepL li.other
{
font-weight: normal;
}
#thePageRHeaderSepL a:link
{
color: #FFFFFF;
}
#thePageRHeaderSepL a:visited
{
color: #80C0C0;
}
#thePageRHeaderSepL a:hover
{
color: #C0E0E0;
}
#thePageRHeaderSepL a:active
{
color: #C0C0C0;
}
.thePageRHeaderSepL_submenu
{
display: none;
position: absolute;
padding: 6px;
border-radius: 12px;
background-color: rgba(160,20,50,0.875);
}
#thePageRHeaderSepR
{
float: right;
}
#thePageRHeaderSepR_input
{
height: 100%;
padding: 6px;
font-size: 11pt;
border-radius: 8px;
background: #FFFFF0 url(//www.google.com/coop/intl/en/images/google_custom_search_watermark.gif) left no-repeat;
}
</style>
<script>
//
var
theTopmenuTable = 0;
var
theTopmenuTimeout = 0;
//
function
theTopmenuTable_hide()
{
if(theTopmenuTable)
{
theTopmenuTable.css({display:'none'});
}
}
function
theTopmenuTimeout_clear()
{
if(theTopmenuTimeout)
{
clearTimeout(theTopmenuTimeout); theTopmenuTimeout = 0;
}
}
//
function
topmenu_mouseout()
{
topmenu_mouseout2(500); return;
}
function
topmenu_mouseout2(msec)
{
//
if(theTopmenuTimeout) clearTimeout(theTopmenuTimeout);
theTopmenuTimeout =
setTimeout (function(){theTopmenuTimeout=0;theTopmenuTable_hide();}, msec);
//
}
//
function
topmenu_mouseover(x0)
{
var jqi = jQuery(x0);
theTopmenuTable_hide();
theTopmenuTimeout_clear();
theTopmenuTable = jqi.next('table');
theTopmenuTable.css({display:'table'});
theTopmenuTable.css (
{top:jqi.position().top+jqi.outerHeight(true)+10}
) ; // end of [theTopmenuTable.css]
theTopmenuTable.css({left:jqi.position().left});
return;
}
//
function
submenu_table_mouseout() { topmenu_mouseout(); }
function
submenu_table_mouseover() { theTopmenuTimeout_clear(); }
//
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="75%">
<div
id="thePageRHeaderSepL"
>
<ul>
<li name="Home" class="self" onmouseout="topmenu_mouseout()" onmouseover="topmenu_mouseover(this)">Home</li>
<table class="thePageRHeaderSepL_submenu" onmouseout="submenu_table_mouseout()" onmouseover="submenu_table_mouseover()">
<tr><td><a href="#What_is_ATS">What is ATS?<a></td></tr>
<tr><td><a href="#What_is_ATS_good_for">What is ATS good for?<a></td></tr>
<tr><td><a href="#Suggestion_on_learning_ATS">Suggestion on learning ATS<a></td></tr>
<tr><td><a href="#Acknowledgments">Acknowledgments</a></td></tr>
</table>
<li name="Downloads" class="other" onmouseout="topmenu_mouseout()" onmouseover="topmenu_mouseover(this)"><a href="Downloads.html">Downloads</a></li>
<table class="thePageRHeaderSepL_submenu" onmouseout="submenu_table_mouseout()" onmouseover="submenu_table_mouseover()">
<tr><td><a href="Downloads.html#ATS_packages">ATS packages</a></td></tr>
<tr><td><a href="Downloads.html#Uninstall_for_ATS">Uninstallation for ATS</a></td></tr>
<tr><td><a href="Downloads.html#Requirements_install">Requirements for installation</a></td></tr>
<tr><td><a href="Downloads.html#Precompiledpack_install">Precompiled packages for installation</a></td></tr>
<tr><td><a href="Downloads.html#Install_source_compile">Installation through source compilation</a></td></tr>
<tr><td><a href="Downloads.html#Install_of_ATS2_contrib">Installation of ATS2-contrib</a></td></tr>
<tr><td><a href="Downloads.html#Install_of_ATS2_include">Installation of ATS2-include</a></td></tr>
<tr><td><a href="Downloads.html#Scripts_for_installing_ATS_Postiats">Scripts for installing ATS-Postiats</a></td></tr>
</table>
<li name="Documents" class="other" onmouseout="topmenu_mouseout()" onmouseover="topmenu_mouseover(this)"><a href="Documents.html">Documents</a></li>
<table class="thePageRHeaderSepL_submenu" onmouseout="submenu_table_mouseout()" onmouseover="submenu_table_mouseover()">
<tr><td><a href="Documents.html#INT2PROGINATS">Introduction to Programming in ATS</a></td></tr>
<tr><td><a href="Documents.html#ATS2TUTORIAL0">A Tutorial on Programming Features in ATS</a></td></tr>
<tr><td><a href="Documents.html#ATS2FUNCRASH0">A Crash into Functional Programming via ATS</a></td></tr>
<tr><td><a href="Documents.html#EFF2ATSPROGEX">Effective Programming in ATS through Examples</a></td></tr>
</table>
<li name="Libraries" class="other" onmouseout="topmenu_mouseout()" onmouseover="topmenu_mouseover(this)"><a href="Libraries.html">Libraries</a></li>
<li name="Community" class="other" onmouseout="topmenu_mouseout()" onmouseover="topmenu_mouseover(this)"><a href="Community.html">Community</a></li>
<table class="thePageRHeaderSepL_submenu" onmouseout="submenu_table_mouseout()" onmouseover="submenu_table_mouseover()">
<tr><td><a href="Community.html#ATS_wikipage">Wiki for ATS users</a></td></tr>
<tr><td><a href="Community.html#ATS_subreddit">ATS news links at reddit</a></td></tr>
<tr><td><a href="Community.html#ATS_IRC_channel">IRC channel for ATS users</a></td></tr>
<tr><td><a href="Community.html#ATS_stackoverflow_tag">StackOverflow tag for ATS</a></td></tr>
<tr><td><a href="Community.html#ATS_QandA_forum">Q&A forum for ATS users</a></td></tr>
<tr><td><a href="Community.html#ATS_devel_forum">Discussion forum for ATS developers</a></td></tr>
<tr><td><a href="Community.html#ATS_mailing_list">Mailing-list for ATS users</a></td></tr>
<tr><td><a href="Community.html#JATS_user_group">JATS-UG: Japan ATS User Group</a></td></tr>
</table>
</ul>
</div>
</td>
<td width="25%">
<div
id="thePageRHeaderSepR"
style="margin-top:6px;margin-bottom:6px;"
>
<form
id="search-form"
action="https://www.google.com/cse"
>
<table>
<tr>
<td>
<input
id="thePageRHeaderSepR_input"
type="text" name="q" size="22"
onblur="if (/^\s*$/.test(this.value)) this.style.background='#FFFFF0 url(//www.google.com/coop/intl/en/images/google_custom_search_watermark.gif) left no-repeat'"
onfocus="this.style.background='#FFFFF0'"
/>
</td>
<td>
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="cx" value="007881927213964201908:gqahxj364ly" />
<!--
<input class="button" type="submit" name="sa" value="Search" />
-->
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
</div><!--thePageRHeaderSep-->
</div><!--thePageRHeader-->
<div id="thePageRBody">
<table
style="width:100%;height:100%;"
cellspacing="0" cellpadding="0">
<tr height="100%">
<td style="vertical-align:top;width:68%;">
<div id="thePageRBodyLeft">
<div id="thePageRBodyLHeader">
<div
style="margin-left:8px;"
>
<h1>About ATS</h1>
<ul name="Home">
<li><a href="#What_is_ATS">What is ATS?<a></li>
<li><a href="#What_is_ATS_good_for">What is ATS good for?<a></li>
<li><a href="#Suggestion_on_learning_ATS">Suggestion on learning ATS<a></li>
<li><a href="#Acknowledgments">Acknowledgments</a></li>
</ul>
</div>
</div><!--thePageRBodyLHeader-->
<div id="thePageRBodyLContent">
<div
class="thePageRBodyLContent"
><!--div-->
<hr></hr>
<h2><a id="What_is_ATS">What is ATS?</a></h2>
<!--
<h2 style="display:inline;">What is ATS?</h2>
-->
<p>
ATS is a statically typed programming language that unifies
implementation with formal specification. It is equipped with a highly
expressive type system rooted in the framework <em>Applied Type
System</em>, which gives the language its name. In particular, both
dependent types and linear types are available in ATS.
</p>
<p>
The current implementation of ATS2 (ATS/Postiats) is written in ATS1
(ATS/Anairiats), consisting of more than 180K lines of code. ATS can be as
efficient as C/C++ both time-wise and memory-wise and supports a variety of
programming paradigms that include:
</p>
<ul
style="list-style-position:outside;"
>
<li
style="margin-top:10px;margin-bottom:10px;"
>
<strong>Functional programming</strong>.
The core of ATS is a call-by-value functional language inspired by ML.
The availability of linear types in ATS often makes functional programs
written in it run not only with surprisingly high efficiency (when compared
to C) but also with surprisingly small (memory) footprint (when compared to
C as well).
</li>
<li
style="margin-top:10px;margin-bottom:10px;"
>
<strong>Imperative programming</strong>.
The novel approach to imperative programming in ATS is firmly rooted in the
paradigm of <em>programming with theorem-proving</em>. The type system of
ATS allows many features considered dangerous in other languages (such as
explicit pointer arithmetic and explicit memory allocation/deallocation) to
be safely supported in ATS, making ATS well-suited for implementing
high-quality low-level systems.
</li>
<li
style="margin-top:10px;margin-bottom:10px;"
>
<strong>Concurrent programming</strong>.
ATS can support multithreaded programming through safe use of pthreads. The
availability of linear types for tracking and safely manipulating resources
provides an effective approach to constructing reliable programs that can take
great advantage of multicore architectures.
</li>
<li
style="margin-top:10px;margin-bottom:10px;"
>
<strong>Modular programming</strong>.
The module system of ATS is largely infuenced by that of Modula-3, which is
both simple and general as well as effective in supporting large scale
programming.
</li>
</ul>
<p>
In addition, ATS contains a subsystem ATS/LF that supports a form of
(interactive) theorem-proving, where proofs are constructed as total
functions. With this subsystem, ATS is able to advocate a
<em>programmer-centric</em> approach to program verification that combines
programming with theorem-proving in a syntactically intertwined
manner. Furthermore, ATS/LF can also serve as a logical framework (LF)
for encoding various formal systems (such as logic systems and type systems)
together with proofs of their (meta-)properties.
</p>
<hr></hr>
<h2><a id="What_is_ATS_good_for">What is ATS good for?</a></h2>
<ul>
<li>
ATS can greatly enforce precision in practical programming.
</li>
<li>
ATS can greatly facilitate refinement-based software development.
</li>
<li>
ATS allows the programmer to write efficient functional programs that
directly manipulate native unboxed data representation.
</li>
<li>
ATS allows the programmer to reduce the memory footprint of a program
by making use of linear types.
</li>
<li>
ATS allows the programmer to enhance the safety (and efficiency) of a
program by making use of theorem-proving.
</li>
<li>
ATS allows the programmer to write safe low-level code that runs in OS
kernels.
</li>
<li>
ATS can help teach type theory, demonstrating both convincingly and
concretely the power and potential of types in constructing high-quality
software.
</li>
</ul>
<hr></hr>
<h2><a id="Suggestion_on_learning_ATS">Suggestion on learning ATS</a></h2>
<p>
ATS is feature-rich (like C++). Prior knowledge of functional
programming based on ML and imperative programming based on C can be a
big plus for learning ATS. In general, one should expect to encounter
many unfamiliar programming concepts and features in ATS and be
prepared to spend a substantial amount of time on learning
them. Hopefully, one will become a superbly confident programmer at
the end who can enjoy implementing large and complex systems with
minimal need for debugging. </p>
<hr></hr>
<h2><a id="Acknowledgments">Acknowledgments</a></h2>
<p>
The development of ATS has been funded in part by <a
href="http://www.nsf.gov">National Science Foundation</a> (NSF) under the
grants no. CCR-0081316/CCR-0224244, no. CCR-0092703/0229480,
no. CNS-0202067, no. CCF-0702665 and no CCF-1018601.
As always, <em>any opinions, findings, and conclusions or recommendations
expressed here are those of the author(s) and do not necessarily reflect
the views of the NSF.</em>
</p>
<hr></hr>
</div>
</div><!--thePageRBodyLContent-->
</div><!--thePageRBodyLeft-->
</td>
<td style="vertical-align:top;width:32%;height:0px;">
<div id="thePageRBodyRight">
<style>
#hello_dats {
font-size: 9pt;
font-family: Lucida Console, Courier New, monospace;
color: #8B0000;
background-color: #FFFAF0;
}
#listsub_dats {
font-size: 9pt;
font-family: Lucida Console, Courier New, monospace;
color: #8B0000;
background-color: #FFFAF0;
}
#repeat_f0f1_dats {
font-size: 9pt;
font-family: Lucida Console, Courier New, monospace;
color: #8B0000;
background-color: #FFFAF0;
}
#queenpuzzle_dats {
font-size: 9pt;
font-family: Lucida Console, Courier New, monospace;
color: #8B0000;
background-color: #FFFAF0;
}
</style>
<div
style="margin-top:8px;padding:8px;"
><!--div-->
<h2 style="display:inline;">Yes, ATS can!</h2>
<hr></hr>
<p>
What is new in the community?
<button
ID="whatisnew_button"
type="button" onclick="Home_whatisnew_onclick()"
>GO</button>
</p>
<hr></hr>
<p>
Would you like to try ATS on-line?
<button
ID="tryatsnow_button"
type="button" onclick="Home_tryatsnow_onclick()"
>OK</button>
</p>
<hr></hr>
<p>
The core of ATS is a typed call-by-value functional
programming language that is largely inspired by ML. For instance, the
following tiny ATS program is written in a style of functional programming:
</p>
<div
width=98% margin=auto
><!--div-->
<table
style="width: 100%; border-spacing: 0px;">
<tr>
<th width="10%"></th>
<th width="80%"></th>
<th width="10%"></th>
</tr>
<tr>
<td></td>
<td align="center">
<textarea
id="hello_dats"
rows="10" cols="36" wrap="off"
>
//
// Yes, you can edit
//
(* Say Hello! once *)
val () = print"Hello!\n"
//
(* Say Hello! 3 times *)
val () = 3*delay(print"Hello!")
val () = print_newline((*void*))
//
</textarea>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td align="center">
<button
ID="hello_button"
type="button" onclick="Home_hello_onclick()"
>Try-it-yourself</button>
</td>
<td></td>
</tr>
</table>
</div>
<hr></hr>
<p>
ATS is both accurate and expressive in its support for (static)
typechecking. The following code demonstrates the ability of ATS in
detecting out-of-bounds subscripting at compile-time:
</p>
<div
width=98% margin=auto
><!--div-->
<table
style="width: 100%; border-spacing: 0px;">
<tr>
<th width="10%"></th>
<th width="80%"></th>
<th width="10%"></th>
</tr>
<tr>
<td></td>
<td align="center">
<textarea
id="listsub_dats"
rows="11" cols="36" wrap="off"
>
//
// Yes, you can edit
//
(* Build a list of 3 *)
val xs = $list{int}(0, 1, 2)
//
val x0 = xs[0] // legal
val x1 = xs[1] // legal
val x2 = xs[2] // legal
val x3 = xs[3] // illegal
//
</textarea>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td align="center">
<button
ID="listsub_button"
type="button" onclick="Home_listsub_onclick()"
>Try-it-yourself</button>
</td>
<td></td>
</tr>
</table>
</div>
<hr></hr>
<p>
ATS is highly effective and flexible in its support for a template-based
approach to code reuse. As an example, the following code is likely to
remind someone of higher-order functions but it is actually every bit of a
first-order implementation in ATS:
</p>
<div
width=98% margin=auto
><!--div-->
<table
style="width: 100%; border-spacing: 0px;">
<tr>
<th width="10%"></th>
<th width="80%"></th>
<th width="10%"></th>
</tr>
<tr>
<td></td>
<td align="center">
<textarea
id="repeat_f0f1_dats"
rows="12" cols="36" wrap="off"
>
//
// Yes, you can edit
//
extern
fun{} f0 (): int
extern
fun{} f1 (int): int
extern
fun{} repeat_f0f1 (int): int
//
implement
{}(*tmp*)
repeat_f0f1(n) =
if n = 0
then f0()
else f1(repeat_f0f1(n-1))
// end of [if]
//
fun
times (
m:int, n:int
) : int = // m*n
repeat_f0f1 (m) where
{
implement f0<> () = 0
implement f1<> (x) = x + n
}
//
fun
power (
m:int, n:int
) : int = // m^n
repeat_f0f1 (n) where
{
implement f0<> () = 1
implement f1<> (x) = m * x
}
//
val () =
println! ("5*5 = ", times(5,5))
val () =
println! ("5^2 = ", power(5,2))
val () =
println! ("2^10 = ", power(2,10))
val () =
println! ("3^10 = ", power(3,10))
//
</textarea>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td align="center">
<button
ID="repeat_f0f1_button"
type="button" onclick="Home_repeat_f0f1_onclick()"
>Try-it-yourself</button>
</td>
<td></td>
</tr>
</table>
</div>
<hr></hr>
<p>
With a functional core of ML-style and certain ad-hoc support for
overloading (of function symbols), ATS can readily accommodate a
typical combinator-based style of coding that is often considered a
prominent signature of functional programming. The following
"one-liner" solution to the famous Queen Puzzle should offer a glimpse
of using combinators in ATS:
</p>
<div
width=98% margin=auto
><!--div-->